Preheat oven to 350°F. Line a baking sheet with parchment paper or aluminum foil. Set aside.
Cut the butternut squash in half, lengthwise. Scoop out the seeds and discard. Place the squash cut side down on the prepared baking sheet. Bake for about 45 minutes or until the squash is tender when pierced with a fork. Allow the squash to cool enough to handle.
Lightly spray a casserole dish with vegetable cooking spray. Set aside.
While still warm, scoop out the butternut flesh and transfer to a large mixing bowl. Discard the skin/shell. Mash the squash with a potato masher, or in a food processor until no chunks remain. Add the milk, vanilla, sugar, butter and cinnamon and stir until combined. Add the lightly beaten eggs. Fold together or process until blended. A few lumps are fine.
Pour the mixture into the prepared baking pan. Bake until almost set, about 30 minutes. While the casserole is baking prepare the topping, if using.
In a small bowl combine the pecans, melted butter, brown sugar and cinnamon. Stir until coated. Remove the baking dish from the oven and sprinkle the pecan mixture over the squash. Continue baking until set, about 15 minutes more.
If using marshmallows, cook the casserole for 45 minutes then remove from the oven. Top with marshmallows while preheating the oven broiler on high. Toast the marshmallow topping until melted and browned. Watch carefully as this happens quickly. Serve immediately.