Place the washed pinto beans in a large pot and cover with several inches of water.
Add the whole, unpeeled onion and bring to a boil over high heat.
Reduce the heat to maintain a steady simmer, cover the pot loosely, and cook until the beans begin to soften, about 30 to 60 minutes.
Season generously with salt and pepper.
Continue to simmer, stirring occasionally, until the beans are tender but still intact, another 30 to 60 minutes.
Add more water as needed to keep the beans submerged.
Drain the beans, reserving at least 1 cup (240 ml) of the cooking liquid.
Discard the cooked whole onion.
Return the beans to the pot.
Add the minced onion, 1 cup (240 ml) of reserved bean liquid (or stock/water), minced chile, cumin, oregano, and garlic. If using nuts, add them now.
If using tofu or tempeh, heat 3 tablespoons (45 ml / 1.5 fl oz) of neutral oil in a separate skillet over high heat.
Add the cubed tofu or crumbled tempeh and cook, stirring frequently, until well-browned.
Bring the chili to a boil over medium heat, then reduce the heat to low, cover, and simmer.
Cook for about 15 minutes, stirring occasionally, to allow the flavors to meld.
Add the browned tofu or tempeh at this stage, if using.
Taste and adjust the seasoning with more salt, pepper, or spices as needed.
Serve hot, garnished with fresh cilantro and your favorite toppings.