Preheat the oven to 400 degrees F.
Peel the squash with a vegetable peeler. Halve lengthwise, discard the seeds, then cut into 1-inch dice. Place in a large bowl.
Heat the butter in a medium skillet over medium-high heat. When the butter ceases to foam and has turned a light brown, pull the pan off the heat and immediately add the sage, rosemary, sugar, vinegar (stand back so as not to get splattered), and molasses. Mix well and bring up to a boil. Reduce heat and let simmer over medium-low heat for 1 to 2 minutes to meld the flavors. Season with a pinch of salt and pepper.
Pour the vinegar mixture over the squash and toss well, then transfer to a heavy rimmed baking sheet or baking dish large enough to hold the squash in a single layer. Place in the oven and roast, tossing at least once, until very tender and caramelized, about 1 hour. Set aside until cool enough to handle but still warm, so the liquids are runny.
Working in batches, if necessary, transfer the warm squash and all the cooking liquids to a food processor and process until smooth. Use immediately, or refrigerate for up to 5 days, or freeze for up to 2 months.