Trim and cut asparagus into 1.5-inch pieces, slice mushrooms 1/4-inch thick (wipe clean with a damp paper towel, do not rinse), and mince the garlic. Grate the Parmesan and zest the lemon if using.
Fill a large pot with water, season generously with kosher salt until it tastes pleasantly salty, and bring to a full rolling boil over high heat.
Cook the spaghetti 1 to 2 minutes less than the package directions, then scoop out at least 1 cup of pasta water before draining. Do not rinse the pasta.
Heat 2 tablespoons of olive oil in a large skillet over medium-high heat, then add the mushrooms in a single layer and cook undisturbed for 3 to 4 minutes until golden. Stir, cook 2 more minutes, season with salt and pepper, then transfer to a plate.
In the same skillet, heat the remaining 1 tablespoon of olive oil over medium-high heat and cook the asparagus for 3 to 5 minutes, stirring occasionally, until bright green and just tender. Season with salt and pepper, then transfer to the plate with the mushrooms.
Reduce heat to medium, melt the butter in the skillet, then add garlic and red pepper flakes and cook for 30 to 60 seconds until fragrant. Add wine (if using) and let reduce for 1 to 2 minutes, then stir in cream (if using) and 1/3 cup of the reserved pasta water.
Add the drained pasta to the skillet and toss with tongs over medium heat, then return the mushrooms and asparagus to the pan and toss to combine. Add the Parmesan and lemon zest, toss again, and adjust consistency with more pasta water as needed.
Divide the pasta among warm bowls and top with extra Parmesan, a drizzle of olive oil, fresh chopped parsley or basil, and a pinch of red pepper flakes. Serve immediately.