Caramelize the Onions:
In a large skillet over medium-low heat, add 1 tablespoon olive oil and 1 tablespoon butter. Add sliced onions and cook slowly, stirring often, for about 20–25 minutes, until deeply golden and sweet. Remove and set aside.
Cook the Pasta:
While onions caramelize, bring a pot of salted water to a boil. Cook farfalle pasta according to package directions until al dente. Drain and set aside, reserving ½ cup of pasta water.
Sauté the Mushrooms:
In the same skillet, add remaining olive oil and butter. Add mushrooms and cook on medium heat until browned and tender, about 5–7 minutes. Season with a pinch of salt and pepper.
Add Garlic and Spinach:
Stir in minced garlic and cook for 1 minute. Then add spinach and cook until wilted, about 2–3 minutes.
Combine Everything:
Add caramelized onions back to the skillet. Toss in the cooked farfalle and a splash of reserved pasta water to help coat everything in the flavorful mixture.
Finish and Serve:
Stir in Parmesan if using, and adjust seasoning with more salt, pepper, or red pepper flakes to taste. Garnish with chopped parsley and serve warm.