In a deep, heavy-bottomed pan, heat the coconut oil over medium flame until it shimmers. Toss in the mustard seeds and let them crackle and pop for a few seconds.
Quickly add the red chili, cumin seeds (if using), and curry leaves. Stir the mixture for about 30 seconds until the aroma intensifies and the spices begin to toast.
Add the chopped pumpkin, along with turmeric and salt. Stir thoroughly so the pumpkin pieces are well coated in the fragrant spice mixture.
Pour in the water, cover the pan with a lid, and reduce the heat to low. Let it simmer for 10 to 12 minutes, or until the pumpkin becomes tender and can be pierced easily with a fork.
Meanwhile, in a small bowl, combine the grated coconut and minced ginger. If using black pepper, stir it in at this stage.
Once the pumpkin is cooked, gently fold in the coconut mixture. Stir with care to maintain the integrity of the pumpkin cubes.
Continue cooking uncovered for another 2 to 3 minutes, allowing the curry to thicken slightly and the flavors to meld.
Serve hot with fluffy steamed rice or warm chapatis for a wholesome, comforting meal.