Pierce the spaghetti squash all over using a knife. Place squash on a plate and microwave on high until fork tender, about 12 minutes. While the spaghetti squash is cooking in the microwave, melt the butter in a skillet on medium heat; add the onion and garlic. Stir and cook until the onions are soft. Stir in the cream of mushroom and sour cream until combined. Season with salt and pepper to taste, then reduce heat to the lowest setting to keep it warm.
Remove spaghetti squash from microwave. Let cool for a few minutes. Use a towel or a pot holder to hold the spaghetti squash and cut lengthwise down the middle and scoop out the seeds with a spoon. Scrape the flesh from the stem to the bottom of the squash using a fork into a bowl. Pour the mushroom mixture from the sauce pan to the bowl and mix together.