Bring a large pot of salted water to a boil.
Whisk the beaten eggs, Parmesan, and black pepper in a mixing bowl until smooth; set aside.
Warm olive oil in a large skillet over medium heat. Cook pancetta until crisp, 4–5 minutes.
Stir in the garlic and cook 30 seconds. Remove skillet from heat to cool slightly.
Cook spaghetti until al dente. Reserve 1/2 cup hot pasta water, then drain.
Return skillet to low heat. Toss hot pasta with pancetta and rendered fat to coat.
Remove from heat. Stream in the egg mixture while tossing quickly, adding splashes of hot pasta water to form a silky sauce.
Stir in butter if using. Season with extra pepper and a pinch of salt to taste.
Serve immediately with more grated Parmesan on top.