Heat the oven to 375° F.
Wash the zucchini. Using a julienne peeler, cut zucchini into long strands. If you do not have a julienne peeler, cut the zucchini lengthwise in thin slices first, then cut the slices into long strands.
Heat 2 tablespoons of olive oil in a non-stick pan. Cook the garlic until fragrant, then add the zucchini strands and cook for 3 to 4 minutes. The zucchini should be soft but not brown.
If using, slice the onion thinly and cook it in a tablespoon of olive oil until soft and beginning to brown.
Crack the eggs into a bowl and whisk until the yolks and whites are combined. Add half the cheese and the salt and pepper.
Heat 2 tablespoons of olive oil or butter in a 12-inch, non-stick, oven-safe frying pan. Add the egg mixture and the zucchini strands. If you are adding sliced cooked onion, add it now.
Cook on medium heat until the egg mixture is golden on the top, about 5 to10 minutes. Sprinkle the rest of the Parmigiano Reggiano on top and put the pan in the oven. Bake for about 5 more minutes until the frittata is cooked. Check by sticking a knife into the frittata. It should come out dry. If the inside of the frittata is still wet, cook a few minutes more.
Serve hot, or at room temperature, cut in wedges. Top with shavings from the chunk of Parmigiano Reggiano.