Bring a large pot of salted water to a boil and cook the penne until just al dente, following package instructions. Drain and set aside.
While the pasta cooks, peel and roast the garlic cloves in a hot oven or skillet until they develop a fragrant aroma and turn golden, about 10 minutes. Let cool slightly, then mash into a smooth paste.
Heat olive oil in a sauté pan over medium heat. Add sliced mushrooms and cook, stirring occasionally, until they release their moisture and turn earthy brown, about 8 minutes. Season with salt and pepper.
Add the chopped spinach to the pan with mushrooms and cook, stirring until the spinach wilts and reduces in volume, about 2-3 minutes. Remove from heat and set aside.
Combine the cooked pasta, roasted garlic paste, sautéed mushrooms and spinach in a large mixing bowl, mixing gently to evenly distribute all components.
Transfer the mixture to a baking dish and sprinkle the shredded mozzarella evenly over the top.
Bake in a preheated oven at 375°F (190°C) until the cheese is melted, bubbling, and golden around the edges, about 15-20 minutes.
Remove from the oven and let sit for a few minutes; this allows the flavors to settle and the dish to set for easier serving.
Serve hot, garnished with additional fresh herbs or a drizzle of olive oil if desired. Enjoy the creamy, cheesy bites packed with earthy mushroom and vibrant greens.