1. Put beans into a medium bowl; cover with cold water by 2 inches. Refrigerate 8 hours (up to overnight). Drain beans and transfer to a large stockpot.
2. Make bouquet garni: Place bay leaves, thyme sprigs, and the peppercorns on a square of cheesecloth; tie into a bundle with kitchen twine. Add stock, onion, and bouquet garni to pot with beans. Bring to a boil. Reduce heat to medium-low. Cover; simmer until beans are tender, about 1 1/2 hours. Drain beans, reserving cooking liquid. Discard bouquet garni.
3. Preheat oven to 350°. Using a keyhole saw, cut out tops of pumpkins, and reserve. Remove seeds. Rub inside of each pumpkin with the oil, and season with salt and pepper. Place pumpkins and tops right side up on baking sheets lined with parchment paper. Bake 25 minutes. Remove tops; let cool completely on a wire rack, and reserve for garnish. Turn pumpkins upside down, and bake until flesh is tender but firm, about 25 minutes more. Let cool completely on rack.
4. Melt 1 tablespoon butter in a large stockpot over medium-high heat. Add sausage. Cook, stirring, until sausage is browned, about 7 minutes. Add remaining 2 tablespoons butter, the pearl onions, potatoes, carrots, leeks, and celery. Cook, stirring occasionally, until vegetables have softened, about 12 minutes. Stir in mushrooms and peas. Stir in flour, and cook 2 minutes.
5. Reduce heat to medium. Add milk; simmer 5 minutes. Stir in beans, reserved cooking liquid, sage, thyme leaves, and 2 cups water. Bring to a simmer; cook until thick, about 30 minutes.
6. Preheat oven to 350°. Divide the stew among pumpkin shells. Place on baking sheets, and bake until pumpkins are soft, about 15 minutes. Garnish with tops.