Heat the oil in a large pan and gently cook the onion and garlic for 10 minutes until soft. Add the cayenne pepper, split peas and the stock, bring to a boil, boil rapidly for 10 minutes then turn the heat down, add the thyme sprigs, cover and simmer for 45 minutes to 1 hour until the split peas are tender, stirring occasionally.
Add the coconut milk, chilli, sweetcorn slices, potato, pepper, allspice and frozen sweetcorn. Season and simmer for 10-15 minutes until the vegetables are tender.
Remove the thyme and sweetcorn slices; using a stick blender, pulse a few times until about half of the soup is blended, you want a chunky texture so don't blend it until it is smooth. Alternatively, place half of the soup in a blender, blend until smooth then return to the pan. The soup should be quite thick but you can thin it with a little extra stock if preferred.
Return the sweetcorn to the pan, serve the soup topped with a swirl of coconut milk or sour cream and a sprinkling of thyme leaves, chilli and allspice.