Preheat the oven to 375°F (190°C).
Cook the penne pasta according to package instructions until al dente; drain and set aside.
In a large skillet, heat olive oil over medium-high heat; add onions and sauté until translucent, about 4-5 minutes.
Add sliced mushrooms and garlic to the skillet; cook until mushrooms are tender, about 5-7 minutes.
Stir in the heavy cream, thyme, salt, and pepper; simmer for 2-3 minutes to thicken slightly.
Combine the cooked pasta with the mushroom cream sauce; mix well to coat.
Transfer the pasta mixture to a greased baking dish; top with grated Parmesan and breadcrumbs.
Bake for 25-30 minutes or until golden and bubbly.
Let it cool for a few minutes before serving; garnish with fresh herbs if desired.