Preheat oven to 350 degrees F.
Using a mandolin, slice potatoes very thinly, about 1/16-inch thick. Immediately place the sliced potatoes in a bowl of very cold water. Let the potatoes sit in the water for a few minutes.
Using the mandolin, slice the shallot very thinly, about 1/16-inch thick, set aside
Grease the bottom and sides of a 9 x 13-inch dish using a tablespoon of butter.
In a measuring cup or a vessel that is easy to pour, mix the heavy cream with the salt, pepper, garlic powder, mustard powder, nutmeg, and red pepper flakes. Set aside.
Drain the potatoes and rinse a couple of times with cold water.
Dry the potatoes off using a paper towel or a clean lint-free kitchen towel.
Place one layer of the potato slices in the bottom of the dish, covering the entire surface of the bottom of the dish. It is OK for the potatoes to overlap a little bit.
Drizzle about ¼ of the cream mixture over the layer of potatoes in the dish.
Sprinkle a few of the chopped green onions and slices of shallot on top of the potatoes and cream.
Do another layer of the potatoes on top of the cream, shallots, and green onions.
This time, instead of cream, sprinkle about ¼ of each of the cheeses on top of the potatoes.
Do another layer of the potatoes on top of the cheese. Once the potatoes are on, give everything a good press down. You want the layers to be nice and tight.
Continue the process of layering and pressing firmly, potatoes, cream with shallots and green onions, potatoes, cheese, potatoes etc until you have just enough potatoes left to do the final top layer.
Arrange the top layer of the potatoes and top with the remaining cream, then top the cream with any remaining cheese.
Cover the dish tightly with aluminum foil. Bake for 40 to 45 minutes.
After 40 to 45 minutes, remove the aluminum foil from the dish and bake for another 20 to 30 minutes until the top is golden.
Remove from the oven and let sit for at least 10 minutes before serving.
Garnish with chopped green onion and fresh black pepper.