Cook the pasta according to package instruction in a large pot of boiling water.
Meanwhile mix the egg yolks, one egg and grated Parmesan in a small bowl and set aside for later. Fry chopped bacon or pancetta with 1 whole garlic clove, that's been slightly crushed, in a pan until the bacon rendered its fat. Remove the bacon to a separate plate and set aside until later. Discard the garlic clove and all fat from the pan but 1 tbsp. Add sliced mushrooms to the pan and cook until golden on medium heat for about 5 minutes, return the bacon to the pan and take it off the heat.
Once the spaghetti is cooked al dente, drain in a colander but keep ½ cup of pasta water. Add the spaghetti to the pan with bacon and mushroom and half of the reserved pasta water and lightly toss to combine. Then add the egg and cheese mixture and toss until the pasta is evenly coated with the sauce. Work quickly to prevent the eggs from scrambling. Add the remaining pasta water if the dish looks dry and continue mixing until the pasta is coated with the sauce. Add salt to taste. Serve with more grated Parmesan and black pepper.
Feel free to leave the bacon out to keep this recipe vegetarian.