This might be the easiest way to cook spaghetti squash — pierce a whole squash all over with a fork, then cook it in a pressure cooker until perfectly tender. It cooks in a fraction of the time it would take in the oven, and there’s no need to struggle with cutting the sturdy squash beforehand.
Special equipment: a 6- or 8-quart Instant Pot® multi-cooker. Cook’s Note: settings may vary on your Instant Pot® depending on the model.
Add 1 cup water to a 6-quart Instant Pot®, then put the rack in the bottom with the handles going up the sides. Deeply pierce the squash all over 12 to 16 times with a fork, then place on the rack (if needed, trim the stem so the squash fits comfortably in the pot, but be careful not to cut into the squash itself).
Follow the manufacturer’s guide for locking the lid and preparing to cook. Set to pressure cook on high for 12 minutes (see Cook’s Note).
Meanwhile, add the canned tomatoes to a medium bowl and use your hands to lightly crush the tomatoes. Set aside.
After the pressure-cook cycle is complete, follow the manufacturer’s guide for quick release and wait until the quick-release cycle is complete. Being careful of any remaining steam, unlock and remove the lid. Use 2 kitchen towels to remove the rack and squash to a cutting board. Carefully pour the water out of the pot. Allow the squash to cool slightly while you prepare the marinara sauce.
Set the pot to high saute and allow it to heat up for 2 minutes. Add 2 tablespoons of the oil, then add the onions and a large pinch of salt. Cook, stirring occasionally, until the onions are softened and starting to brown lightly, 6 to 8 minutes. Add the garlic and a pinch of red pepper flakes and cook, stirring frequently, until the garlic is softened, 2 to 3 minutes. Stir in the reserved tomatoes and a large pinch of salt and bring to a strong simmer; cook, stirring occasionally, until the sauce is reduced slightly and thickened, about 10 minutes. Season with additional salt and red pepper flakes if needed.
While the sauce is reducing, remove the squash from the rack and split it in half lengthwise. Use a spoon to remove the seeds, then use a fork to scrape the strands of squash from the inside of the skin.
Transfer the squash to a large platter and stir in the remaining 2 tablespoons oil, 1 teaspoon salt and red pepper flakes to taste. Season with more salt if needed, then top with the hot marinara sauce. Sprinkle with the Parmesan and basil.