Preparing the Spaghetti Squash:
Preheat oven to 400°F (200°C).
Cut spaghetti squash in half lengthwise and scoop out seeds. (Tip: Microwave whole squash for 2-3 minutes if too hard to cut.)
Drizzle cut sides with 2 tablespoons melted butter, season with salt and pepper.
Place halves cut-side down on parchment-lined baking sheet.
Roast for 45-60 minutes until fork-tender.
Let cool, then scrape flesh into spaghetti-like strands with a fork. Set aside.
Making the Cheese Sauce:
In large saucepan over medium heat, melt remaining 2 tablespoons butter.
Add chopped onion and cook 5-7 minutes until soft and translucent.
Add minced garlic and cook 1 minute until fragrant.
Sprinkle flour over mixture, stirring constantly for 1-2 minutes to create a roux.
Gradually whisk in milk, starting with small amounts to prevent lumps.
Bring to simmer over medium heat, stirring constantly.
Reduce heat to low and simmer 5-7 minutes until sauce thickens.
Remove from heat and season with salt, pepper, and nutmeg.
Stir in 3/4 cup Gruyere, 3/4 cup cheddar, and 1/4 cup Parmesan until melted and smooth.
Assembling and Baking:
Add shredded spaghetti squash to cheese sauce, folding gently to combine.
Pour mixture into greased 9x13 inch baking dish.
In small bowl, combine remaining cheeses with panko breadcrumbs.
Sprinkle topping evenly over squash mixture.
Bake at 400°F for 20-25 minutes until golden brown and bubbly.
Let rest 5-10 minutes before serving.
Garnish with fresh parsley if desired.