Heat the oil in a medium pot or a deep skillet over medium heat. When the oil is hot, add the onions. Cook the onions, stirring frequently, for 7 minutes, or until they're soft and just browning. Add splashes of water as needed to prevent sticking. When the onions are ready, stir in the garlic and cook for 1-2 minutes, or until fragrant, stirring constantly.
Add the rice, turmeric, cumin, coriander, salt, bay leaf, and water to the pot. Bring to a boil, reduce heat to low, and cover. Simmer for 12-15 minutes (for white rice) or for 30-35 minutes (brown rice), or until the rice is tender.
Pour in the extra 1/2 cup water, then add the spinach to the pot, piling it over the rice. Cover the pot again to allow the spinach to steam and wilt down for 2 minutes. Then, stir the spinach into the rice, so that it wilts down completely. (If you need to add a few splashes of additional water as you do this, go for it.) Finally, stir in the kidney beans, lemon and lime juice, and black pepper to your liking. Taste the rice, adjust seasonings as needed, then stir in the cilantro, if using.