1. Preheat oven to 350°. Cut squash in half lengthwise and remove seeds. Place the squash halves, cut side up, on a baking pan, then cover with foil and bake until tender when pierced with a fork, 20 to 30 minutes. Uncover and let sit until cool enough to handle, then use a spoon to scoop out the cooked squash from the peel. Mash with a fork. Measure out 1 cup of the squash and set aside any remaining for future use (see Notes).
2. Turn oven down to 325°. Butter an 8- by 8-in. baking pan and set aside.
3. In a small bowl, combine flour, allspice, cinnamon, nutmeg, baking powder, salt, baking soda, and pepper. Set aside.
4. With a mixer, cream together butter and brown sugar in a large bowl until smooth and a bit fluffy. Add eggs one at a time, beating for 30 seconds after each addition. Mix in vanilla.
5. Add half of the flour mixture to the butter mixture and stir to combine. Stir in the cup of mashed squash. Add remaining flour mixture and stir just enough to combine. Pour batter into prepared baking pan and bake until a toothpick inserted in the center comes out clean, 50 to 60 minutes. Serve plain or with a dusting of powdered sugar or a dollop of whipped cream.
Note: Nutritional analysis is per serving.
Extra mashed squash may be served hot with butter, salt, and pepper; stirred into soups or stews; or frozen for future cakes. Whole-wheat pastry flour is sold at health food and specialty baking stores, as well as at Whole Foods stores.