Bring a large pot of salted water to a rolling boil and prepare a bowl of ice water.
Add spinach in batches to the boiling water and blanch 30–45 seconds until wilted but bright green.
Drain spinach in a colander and immediately plunge into ice water to stop cooking; squeeze out excess water and finely chop.
In a large skillet, melt butter with olive oil over medium heat to prevent browning.
Add chopped onion or shallots and cook 3–4 minutes until translucent and soft.
Stir in minced garlic and cook 30 seconds until fragrant.
Sprinkle flour over the softened aromatics and whisk for 1 minute to form a light roux.
Gradually whisk in milk (and cream if using) until smooth, simmer gently until the sauce thickens, about 2–3 minutes.
Season the sauce with salt, pepper, and grated nutmeg; add cayenne if desired.
Fold the drained, chopped spinach into the cream sauce and simmer 1–2 minutes just to heat through.
Stir in grated Parmesan or Gruyère if using, adjust seasoning, remove from heat and serve immediately.