Heat butter in a large skillet over medium-high heat; cook and stir onions until brown, soft, and sweet, 40 to 45 minutes. Let onions cool for a few minutes.
Preheat oven to 375 degrees F (190 degrees C). Remove tart shells from freezer and place on baking sheets lined with parchment paper.
Combine caramelized onions with pears, blue cheese, and walnuts in a large bowl. Spoon pear-blue cheese filling into still-frozen tart shells.
Bake in the preheated oven until the filling is hot and melted and the pastry shells are lightly browned, 15 to 20 minutes. Serve warm or cooled.