01 - Preheat oven to 400°F. Line a baking sheet with parchment paper. Halve the spaghetti squash lengthwise, scoop out seeds, brush cut sides with olive oil, and place cut-side down. Roast for 35-40 minutes until tender and easily shredded with a fork.
02 - While squash roasts, heat a large skillet over medium heat with olive oil. Sauté onion, bell pepper, jalapeño (if using), and garlic for 4-5 minutes until softened.
03 - Stir in corn, black beans, drained tomatoes, cumin, chili powder, smoked paprika, oregano, salt, and pepper. Cook for 3-4 minutes, stirring occasionally. Remove from heat.
04 - Once cool enough to handle, use a fork to shred the spaghetti squash flesh into strands. Reduce oven temperature to 375°F.
05 - In a large mixing bowl, combine shredded squash with vegetable-bean mixture. Stir in half of the cheddar and Monterey Jack cheeses.
06 - Transfer mixture to a lightly greased 9x13-inch casserole dish. Sprinkle remaining cheese evenly on top.
07 - Bake for 20-25 minutes until casserole is hot throughout and cheese is bubbly and lightly golden.
08 - Top with chopped fresh cilantro and serve with lime wedges on the side.