In a medium bowl, whisk eggs, yolks, cheeses, pepper and a pinch of salt.
In a large sauté pan, cook the bacon over medium heat, stirring occasionally, for 8–10 minutes, until the fat renders and the edges are crisp. Add the onion, increase the heat to medium-high, and sauté for 5–7 minutes, until golden brown.Note: If using a nonstick pan, additional oil may not be necessary. For regular bacon, trim excess fat or drain/mop the grease with a paper towel, leaving about 1/2 tablespoon in the pan. If spaghetti won’t lie flat in the pan, break it in half. Add spaghetti, 4½ cups water and 1 tsp salt to pan. Cook, uncovered, stirring and tossing frequently, 12–14 minutes or until spaghetti is cooked through but still al dente. If skillet dries through before pasta is cooked through, add a little bit more water.
Remove pan from heat. Stir in egg mixture, tossing well. Add spinach, in batches as it begins to wilt, basil, parsley and remaining ½ tsp salt. Toss until everything is well incorporated. Cover and let stand 2 minutes to allow spinach to fully cook. Uncover; toss again. Serve immediately, garnished with additional pecorino, sweet corn, and pepper, if desired.