Heat a tablespoon of oil in a frying pan over medium heat. Add the chopped onion and cook for 3-4 minutes until soft, then add the garlic, cumin and chilli powder and cook for another minute.
Add the drained kidney beans to the pan with a splash of water. Mash them roughly with the back of a fork or a potato masher, leaving some chunks for texture. Season with salt and pepper and cook for 2-3 minutes until heated through. Remove from the heat.
Lay out 4 tortillas. Divide the bean mixture between them, spreading it over one half of each tortilla. Sprinkle the grated cheese over the beans, then fold each tortilla in half to make a half-moon shape.
Heat a large dry frying pan over medium-high heat. Cook the quesadillas one or two at a time for 2-3 minutes on each side until the tortilla is crisp and golden with char marks, and the cheese is melted inside.
Cut each quesadilla into 3 wedges with a sharp knife or scissors. If using the chopped tomatoes, heat them in a small pan with a pinch of salt to make a quick dipping sauce.
Serve immediately while the cheese is still molten. A spoonful of natural yogurt or sour cream on top is good if you have some.