01 - Preheat oven to 350°F. Butter a 9x13 inch baking dish thoroughly.
02 - In a saucepan over medium heat, melt butter. If using, add chopped onion and cook until softened, about 3 minutes. Add garlic and sauté 1 minute until fragrant.
03 - Stir in heavy cream, whole milk, salt, pepper, and nutmeg. Heat gently until steaming but not boiling, then remove from heat.
04 - Arrange half of the potato slices in the baking dish, overlapping slightly. Pour half the cream mixture over potatoes and sprinkle evenly with half of both cheeses.
05 - Layer remaining potato slices on top. Pour remaining cream mixture over, then sprinkle with remaining cheddar and Gruyère cheeses.
06 - Cover dish tightly with aluminum foil. Bake for 45 minutes.
07 - Remove foil and bake an additional 15 to 20 minutes until golden, bubbly, and potatoes are tender when pierced.
08 - Let stand for 10 minutes before serving. Garnish with chopped chives or parsley if desired.