Heat a Dutch oven or a large saucepan over medium-high heat. Add the coconut oil, and once shimmering, add the onions and carrots along with a pinch of kosher salt. Cook the vegetables for 7-8 minutes, or until they are tender and lightly browned.
Add the garlic, ginger, chili peppers (if using), lemongrass (if using), and red curry paste, and cook for 2 minutes, stirring frequently to coat the vegetables & prevent burning. If not using a nonstick pan, you'll likely need to add a tablespoon or two of water to prevent the mixture from drying out, sticking, and burning.
Pour in a couple spoons of the coconut milk and allow it to bubble for a minute, stirring well. Add the vegetable broth, stirring with a spatula to scrape up any browned bits stuck to the bottom of the pot. Pour in the remaining coconut milk, cubed squash, soy sauce, and coconut sugar, stirring to combine.
Bring the mixture to a boil, then reduce the heat to low or medium-low to maintain a rapid simmer for 20 minutes, or until the squash is tender and cooked through. Turn off the heat and use an immersion blender to blend roughly half of the curry. Make sure to leave some chunks of squash intact. Alternatively, transfer half of the curry to a stand blender. Blend until the mixture is puréed and mostly smooth, then return it to the pan and stir to combine. Stir in the chickpeas and bring the curry to a gentle simmer. Once simmering, stir in the baby spinach or kale, stirring until the greens have wilted.
Turn off the heat, and stir in the lime juice or rice vinegar. Taste for seasonings, adding salt as needed. Tear the Thai basil leaves to release their oils; add them to the curry, along with the chopped cilantro.
Serve the curry over rice. Garnish with additional cilantro or Thai basil as desired.