Heat the oven to 400 degrees. In a large, ovenproof skillet, melt the butter over medium. Spoon out 1 tablespoon of the butter into a medium bowl. To the skillet, add the onion and garlic, season with salt and pepper, and cook, stirring occasionally, until softened but not browned, 7 to 10 minutes.
While the onions are sautéing, stir the bread crumbs into the bowl of butter until coated, season with salt and pepper, then stir in half the Parmesan.
Add the spinach to the skillet and stir until warm and dry, perhaps even sticking to the skillet, 2 to 4 minutes. Turn off the heat. Stir in the half-and-half, remaining Parmesan and the nutmeg (if using), then taste and adjust seasonings with salt and pepper. (If you’d like to bake this dish in a 2 ½-quart or larger casserole dish rather than directly in the skillet, transfer the spinach now.)
Top evenly with the Gruyère, then the panko mixture. Bake until golden on top and bubbling around the edges, 20 to 25 minutes.
