Bring a large pot of generously salted water to a rolling boil.
While the water heats, finely mince the garlic, cut the halloumi into 1/4-inch-thick slices, and grate the Parmesan if it has not already been prepared.
Crack the room-temperature egg into a bowl. Add the grated Parmesan and whisk thoroughly until the two ingredients are evenly combined. Keep the mixture at room temperature until needed.
Add the spaghetti to the boiling water and cook according to the package instructions until al dente.
Before draining the pasta, scoop out and reserve 1/2 cup of the starchy cooking water. Drain the spaghetti.
Heat the extra-virgin olive oil in a large skillet over medium-high heat until shimmering.
Arrange the halloumi slices in a single layer. Sear for approximately 2 minutes, or until the underside develops a golden crust. Turn each piece and cook the second side for another 2 minutes, until lightly browned.
Add the finely minced garlic and cook for about 30 seconds, just until aromatic.
Remove and discard the garlic, allowing its flavor to remain infused in the olive oil.
Transfer the cooked spaghetti to the skillet containing the seared halloumi.
Pour in between 1/3 and 1/2 cup of the reserved pasta water. Toss the mixture over medium heat for about 1 minute so the spaghetti becomes evenly coated.
Season generously with freshly ground black pepper.
Take the skillet completely off the heat before adding the egg mixture. This step is essential for preventing the egg from scrambling.
Immediately pour the egg-and-Parmesan mixture over the hot spaghetti. Stir quickly and continuously so the residual heat gently thickens the egg and produces a creamy, cohesive sauce.
Continue stirring vigorously for approximately 30 seconds, ensuring the sauce is evenly distributed and remains smooth rather than forming cooked pieces of egg.
Taste the finished pasta and add kosher salt and additional freshly ground black pepper as necessary.
If the carbonara sauce has become thicker than desired, incorporate a small splash of the remaining reserved pasta water and stir until the preferred consistency is reached.
Divide the halloumi carbonara between serving bowls or plates and serve immediately while hot. Finish with another grinding of black pepper, if desired.