Bring a large pot of salted water to the boil and cook 300 g pasta to al dente according to the package. Reserve a cup of the cooking water before draining.
Meanwhile, finely chop 2 onions, 5 garlic cloves, and 1 piece of ginger (thumb-sized).
Heat 2 tbsp oil in a wide pan over medium heat. Sauté the onions for 3 min until translucent, then add the ginger and garlic and cook 30 sec more until fragrant.
Add 2 cans of chunky tomatoes and simmer for 8–10 min until the liquid has reduced. Stir in 50 g instant coconut powder (or substitute 200 ml coconut milk — in which case simmer longer to thicken). Season with salt, pepper, paprika, curry powder, and cayenne to taste.
Toss the drained pasta into the sauce, loosening with pasta water if needed.
Make the pesto: halve and pit 2 avocados; scoop the flesh into a blender with a dash of lemon juice and 1 packet of fresh or frozen basil. Blend to a smooth paste and season with a pinch of salt, paprika, curry, and cayenne.
Plate the pasta and top each serving with a generous spoonful of avocado pesto.