Heat the oil in a large soup pot over medium heat. Add the onion and the white parts of the scallions. Cook, stirring occasionally, until softened, about 4 to 5 minutes.
Stir in the garlic, thyme, allspice, and black pepper. Cook for 30 seconds, just until fragrant.
Add the squash, potato, okra, broth, coconut milk, and salt. Bring the soup to a gentle boil, then reduce the heat to maintain a steady simmer.
Cover partially and simmer until the squash and potato are very tender, about 15 to 18 minutes. Stir once or twice so the vegetables do not stick to the bottom.
Add the spinach in large handfuls, stirring until it wilts into the soup. Simmer uncovered for 2 to 3 minutes.
For a thicker, creamy soup, use an immersion blender to blend briefly in the pot, leaving some vegetables whole. Alternatively, carefully blend about 2 cups of the soup in a countertop blender and return it to the pot.
Stir in the green parts of the scallions and the lime juice. Taste and add more salt if needed. Serve warm with hot sauce at the table, if desired.