Sauté Pancetta: Set the Instant Pot to Sauté (More/High setting). Heat olive oil for about 3 minutes, then add pancetta. Cook for about 8 minutes until browned. Remove pancetta with a slotted spoon, leaving the oil in the pot.
Cook Aromatics: Add diced onion and sauté for 3 minutes until softened. Pour in white wine, stirring to deglaze the pot and loosen browned bits. Add garlic and cook for another minute before pouring in the broth.
Add Pasta: Break spaghetti in half and place it into the pot. Do not stir—just press it down slightly to ensure it's submerged. Add 2 tablespoons of butter on top.
Pressure Cook: Seal the Instant Pot lid, switch the valve to "Sealing," and set it to Pressure Cook (High) for 8 minutes. Once done, perform a quick release.
Prepare Egg Mixture: While pasta cooks, whisk eggs, grated Parmesan, and salt in a bowl. Set aside.
Incorporate Dairy: Once the pressure is released, add the remaining 2 tablespoons of butter and stir until melted. Pour in the heavy cream and nutmeg, followed by the egg mixture.
Thicken the Sauce: Turn the Instant Pot back to Sauté (More/High). Stir the pasta constantly as the sauce heats up and thickens, about 3–5 minutes. Once the sauce starts clinging to the pasta, turn off the heat.
Final Touches: Stir in grated Pecorino Romano and reserved pancetta, leaving some aside for garnish. Toss until well combined.
Serve Immediately: Plate the pasta and top with the remaining pancetta and extra cheese if desired.