Preheat the oven to 400° F (205° C).
Mix together all of the spices in a bowl and set aside. If your fennel seeds were whole, you can crush them or you can just chop them up using a knife, or put all of the spices along with the coconut in a spice grinder and pulse a few times to powder them and set aside.
Press the tofu, if you haven't already, then tear into bite-sized pieces and add to a bowl then along with the ginger garlic paste and oil. Toss well to coat.
In a small bowl mix the cornstarch, salt, Kashmiri chili powder and 1 ½ to 2 teaspoons of the spice mix from above. Sprinkle this all over the tofu mixture, tossing well to coat. Spread the tofu on a parchment-lined baking sheet and bake for 20 to 30 minutes, or until most of the tofu is starting to get slightly crisp on the edges.
To cook the tofu in a skillet instead: Heat a large skillet over medium-high heat and add 2 teaspoons of oil. Once the oil is hot, add the tofu to the skillet and cook, flipping occasionally, until it is crisp on most of the edges. This can take anywhere from 6 to 8 minutes. Remove it from the skillet, and use the same pan to make the sauce.
Heat a large skillet over medium heat, and add the oil. When the oil is hot, add the curry leaves carefully and mix in. Once they stop spluttering, Add in the onion and a good pinch of salt and mix . Cook until the onion is golden. Add splashes of water in between to help the onions brown evenly and to help conduct the heat evenly, 6 to 9 minutes.
Stir in the ginger garlic paste and the remaining spice mix, and cook for 1 to 2 minutes, until the spices start to smell roasted and the garlic is cooked.
Mix in the tomato and salt, then cook until the tomatoes are mushy. 5-7 mins. Press and mash some of the larger tomato pieces, then add in the coconut milk or water, mix in, and cover the skillet with a lid.
Bring to a boil, then simmer for another 2 minutes, then carefully taste and adjust salt, flavor, and thickness. If you want more sauce, you can add in some more coconut milk, non-dairy milk, or water and bring to a boil. Once it is boiling, lightly fold in the baked tofu, then switch off the heat and garnish with cilantro and lime juice. Serve with rice, South Indian parotta, naan, or dosa.