Preheat the oven to 375˚F (190˚C). Rub a 9x13-inch or similar sized baking dish with olive oil.
Heat the olive oil in a medium skillet over medium-high heat. Add the onion, and season with salt and pepper. Cook, stirring often, until softened and golden, about 3-4 minutes. Add the garlic and cook, stirring, until fragrant, about 1 minute. Transfer to a small bowl and cool slightly.
Cut the zucchinis in half lengthwise. Using a small knife, score the flesh (not all the way to the skin), leaving a ¼-inch border. Using a small spoon (a grapefruit spoon works great) scrape out the seeds and discard. If the squash halves are rolling around, cut a very small sliver off the bottom of each so that they lie flat. Place the zucchini halves, cut sides up, in the prepared baking dish.
To the bowl with the onions, add 1 cup of the Comté cheese, the ricotta, the beaten egg, scallions and herbs. Season with salt and pepper, and stir to combine.
Sprinkle the zucchinis with salt and pepper. Spoon the filling down the center of each. Sprinkle the remaining 2 tablespoons of Comté evenly over top.
Bake until tender and golden, about 30 minutes. Let cool slightly then garnish with more herbs and pine nuts, if using.