Wash the rice in several changes of water until the water runs clear. Soak the rice in water, generously covered, for at least 30 minutes. (This is optional but results in softer, more evenly cooked rice.) Drain thoroughly using a fine-mesh sieve.
In a soup pot, dry-roast and stir the lentils continuously over medium heat until they are golden brown and have a nutty aroma, 2 to 3 minutes. (This step is optional but reduces the stickiness of the dal.) Thoroughly wash the lentils using a fine-mesh colander. Return them to the pot, together with the rice, and add 3 1⁄2 cups of water. Bring to a boil. Skim the foam off the top. Add the turmeric powder, 2 tablespoons of the ghee, and the ginger to the boiling mixture.
Cover and cook over low heat until the rice and lentils are completely cooked, about 20 minutes. At this point, the grains will look separate. Add another 1⁄2 cup of water and continue to cook over medium-low heat, partially covered, for about 5 minutes. When you stir the mixture, it should have a creamy consistency. Feel free to mash the rice and lentils with a spoon. The consistency should be similar to a risotto. Turn off the heat.
While the rice and lentils are cooking, put 1⁄2 teaspoon of the ghee in a tempering pot or small pan over medium heat. Add the cashews, stirring them until they are fragrant and turn golden brown, a few minutes. Set the cashews aside to cool in a bowl lined with a paper towel. If using cumin seeds and peppercorns, roughly crush them in a mortar with a pestle. Set aside.
When the rice and lentil mixture is cooked, mix in the salt, coconut, and fried cashews, reserving some cashews for garnish.
Put the remaining 2 tablespoons of ghee in the tempering pot or small pan over medium heat. When melted, add the crushed black peppercorns and cumin seeds and the asafetida. Fry for a few seconds until fragrant. Turn off the heat.
Immediately pour the spiced ghee over the rice. To get all of the spiced ghee out of the pot, put a spoonful of the rice mixture into the pot, stir, and spoon it back into the rest of the dish. Taste for salt and adjust as needed. Garnish with the reserved cashews. Serve hot. When reheating, add a little water to loosen up the dish, as it has a tendency to dry out.