Press the "sauté" button on your Instant Pot then add the oil.
Give the oil a minute to heat up, then add the onion and carrot. Sweat the vegetables for 5 minutes, stirring occasionally, until they begin to soften.
Add the garlic, ginger, curry powder, garam masala, cumin and cayenne pepper, if using. Sauté the mixture for 1 minute, stirring constantly. Press the "cancel" button.
Stir in 4 ½ cups of broth, along with the lentils, potato, and tomatoes.
Place the lid on your Instant Pot and set the valve to the "sealing" position. Press the "pressure cook" or "manual" button and set the pressure to high. Set the soup to cook for 15 minutes.
When the soup has finished cooking, carefully move the valve to the "venting" position. Let the pressure release completely.
Remove the lid from the Instant Pot. Stir in the coconut milk and thin the soup with additional broth, if desired. Season the soup with salt and pepper to taste.
Ladle into bowls and serve.