Bring a large pot of water to a rolling boil and generously salt it, then add the spaghetti and cook until al dente according to package directions.
While the pasta cooks, heat the extra virgin olive oil in a large skillet over medium to medium-low heat.
Add the thinly sliced garlic to the oil and stir constantly until the garlic is just golden and fragrant, taking care not to burn it.
Stir in the red pepper flakes, then remove the skillet from the heat.
When the pasta is done, reserve at least 1/2 cup of the cooking water and drain the pasta in a colander.
Transfer the drained pasta to the skillet, add at least 1/2 cup of the reserved pasta water, and toss thoroughly to combine and coat the spaghetti with the garlic oil.
If using, add the chopped parsley and grated Parmesan and toss lightly to distribute evenly.
Serve immediately while hot.