Step 1Wash the basmati rice, then soak it for 3 hours in 2 cups of water salted with one-half teaspoon salt.
Step 2In a medium saucepan over medium-low heat, melt the butter. Add the cinnamon, cardamom pods and black peppercorns and gently fry the spices until their aromas start to be released, about 4 minutes.
Step 3Drain the rice well, add it to the pan and stir to coat for a minute. Increase the heat to medium-high. If you are using pistachios, barberries or both, stir them in now. Pour enough water over the rice to cover it roughly by half an inch, and season with one-half teaspoon salt.
Step 4Cut a round of parchment paper that will fit over the surface of the water, and place it in the pan. Place a lid on the pan and bring to a boil over high heat. Decrease the heat to a simmer and continue to cook for 5 minutes, then lift the lid and paper off the pan and drizzle the saffron water evenly over the rice. Replace the paper and lid and continue to cook 4 to 5 minutes more until the rice is tender and the water is absorbed.
Step 5While the rice is cooking, whisk together the yogurt with the crushed garlic, 1/8 teaspoon salt and a pinch of pepper in a medium bowl. Taste and adjust seasoning as desired.
Step 6Serve the rice with the caramelized onions sprinkled over the top and the seasoned yogurt on the side.