Bring a large pot of salted water to a boil. Add the spaghetti or fettuccine and cook according to package instructions until al dente. Reserve ½ cup of pasta water, then drain the pasta in a colander and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute, until fragrant, being careful not to burn it.
Add the sliced mushrooms to the skillet and cook for about 5-7 minutes, stirring occasionally, until the mushrooms are tender and browned.
Pour in the vegetable broth or reserved pasta water, and add red pepper flakes. Stir to combine, allowing the liquid to simmer for 2-3 minutes to reduce slightly.
If using, stir in the heavy cream, mixing well. Season the sauce with salt and pepper to taste.
Add the drained pasta to the skillet, tossing it gently with the sauce until evenly coated. If the pasta appears dry, add a bit more reserved pasta water to loosen it.
Stir in the grated Parmesan cheese until melted and well incorporated.
Serve hot, garnished with chopped fresh parsley and extra Parmesan cheese on top.