In a medium saucepan over medium heat, warm the olive oil until shimmering.
Add the onions and salt, stirring occasionally until the onions have softened and are translucent, 5-8 minutes.
Add the garlic, chili powder and cumin, cooking and stirring constantly until fragrant, about 30 seconds.
Pour in drained beans and water.
Stir, cover and cook for 5 minutes.
Reduce heat to low and remove lid.
Use a potato masher to mash up at least half of the beans until you have reached the desired consistency.
Continue to cook for about 3 minutes.
Remove saucepan from heat and stir in the cilantro (if desired) and lime juice.
Taste and add more lime juice if necessary.
If the beans seem too dry, add a splash of water.
Serve with cheddar cheese for topping.
Chef's notes: Or 3 cups of cooked pinto beans. Save the liquid from the cooked beans and use in place of the water. ¼ cup finely chopped green peppers may be added with the onions if desired.