Bring a large pot of salted water to boil, then the cook spaghetti for about 8 minutes(or according to package directions). Save ½ cup of the pasta water, drain the pasta and set aside.
Heat a large fry pan or sauté pan to medium-high heat. Add the bacon, garlic, and olive oil and fry until crispy and browned, about 4-5 minutes.
Next, add the mushrooms to the pan and cook until all the water has evaporated and the mushrooms are slightly browned, about 3-4 minutes.
Transfer the cooked spaghetti to pan with the mushrooms and bacon and remove from the burner.
Beat the eggs with ½ cup of the reserved pasta water, slowly add to pasta off heat. Return the pan to low heat and stir until thickened.
Add butter, pecorino, and salt. Cook for additional 1-2 mins. Add more pasta water if too thick. Serve with cracked pepper.
Notes
Beating the eggs with the hot pasta water is technique called tempering and is essential so the eggs don't scramble when they hit the pan.