Preheat the oven to 400 F.
Make the "pasta": Cut the spaghetti squash in half lengthwise and scrape out the seeds. Drizzle the cut sides with 1 tablespoon of oil and sprinkle with salt and pepper. Place the squash face-down on a rimmed baking sheet and add 2 tablespoons of water to the baking sheet. Bake for 35 to 40 minutes, until the squash is fork-tender and the skin gives when you press your finger into it. Remove from the oven and set aside to cool. Leave the oven on, but reduce the temperature to 350 F.
While the squash is baking, prepare the sauce: In a large saute pan over medium heat, cook the bacon until crispy, about 10 minutes. Remove to a paper towel to cool, then crumble it.
In a medium skillet over medium heat, saute the garlic in the 2 tablespoons of oil for 2 minutes, until fragrant. Add the onion and saute for 2 minutes, or until it begins to become translucent. Lightly salt and pepper the chicken, then add to the skillet and cook until golden and no pink remains. Add the Italian seasoning, garlic powder onion powder, salt, black pepper, and red pepper flakes. Mix to combine.
Remove the skillet from the heat and mix in the mayo. Add the bacon and mix again.
Once the spaghetti squash has cooled, take two forks and fluff the threadlike spaghetti within the boats so its no longer attached to the walls of the squash.
Add the chicken mixture to the center of each boat and mix to combine it with the "spaghetti."
Top with the cheese, if using, and bake for 10 minutes, until the cheese is bubbly. Garnish with basil and serve immediately.