Caramelize the onions: Peel the onions and cut into thin slices. Heat clarified butter in a big frying pan or pot. Add the onions. You can start cooking them over medium-high / medium heat, and then gradually lower the heat as they start to get color to medium-low / low heat. Don't cook the onions over too high heat or they will burn and be bitter. Stir from time to time (at the beginning rarely, later more often, and at the end very often). The onions should be partially caramelized and it should take about 30 minutes. We don't need to fully caramelize the onions (this would take about 50-60 mins) because they will be baked in the oven. Unfortunately, this process can not be speeded up. Take the onions off the pan and leave to cool.
Preheat the oven to 375°F / 190°C / Gas Mark 5, no fan.
Cut the pear into quarters, core it and cut into thin slices. You can leave the skin on.
Take the dough out of the fridge. Score the dough: with the tip of a sharp knife, score through the top layers of the puff pastry by running the knife along all four sides of the dough (leave about 1/2 inch / 1.5 cm border). Do not cut all the way through the dough. Transfer the pastry, along with the parchment paper that comes with it to a baking sheet. Prick the dough (not the borders) with a fork.
Place the pear slices on top of the dough.
Divide the caramelized onions evenly over the pear slices.
Crumble blue cheese on top.
Brush the edges of the tart with heavy cream or make the egg wash (whisk 1 egg with 1 Tbsp of milk) and brush the pastry with it.
Bake the tart in a preheated oven for about 25 minutes or until puffed and golden.