Preheat oven to 400° F. In a large Dutch oven or an oven-proof skillet with a tight-fitting lid, melt butter over medium heat. Add onions and cook until just tender, about 3-5 minutes.
Increase the heat to medium-high and add the sliced mushrooms. Cook, stirring, until they begin to sweat, about 3 minutes, then add garlic and thyme. Cook, stirring, until fragrant, about 30 seconds. Stir in the rice and cook, stirring, until the rice is well coated in the pan juices, about 1-2 minutes. Add the wine and broth, then season with salt and pepper to taste.
Bring the mixture to a simmer, then cover with the lid and transfer the dish to the oven. Bake until the liquid is absorbed and the rice is tender, about 45 minutes.
Remove dish from oven, carefully take off the lid, and stir in the peas (if using), Parmesan, and parsley until creamy. I like to use a fork to fluff the rice as I stir, which helps prevent it from clumping together. Serve immediately.