Special equipment: a tortilla press, optional
For the spicy pinto beans: Soak the pinto beans in water to cover overnight. Drain and set aside.
Heat the oil in a large enameled Dutch oven over medium heat. Add the garlic, onion and pepper and cook, stirring, until slightly softened, about 3 minutes. Add the beans, cumin, paprika, guajillo chile, cayenne if using and enough water to just cover the beans and bring to a boil over medium heat. Reduce the heat to a simmer and cover with the lid slightly ajar. Cook until just tender, about 1 hour, checking the water level every so often and adding more water if the mixture dries out. Stir in 1 teaspoon each salt and pepper.
Add the flour and butter to a small cast-iron skillet and stir to create a paste. Cook over medium-low heat until the paste forms a golden roux, about 3 minutes.
Remove the guajillo chile from the beans, stir in the roux and bring back to a simmer. Add the cheese and tomatoes, then continue to cook until the mixture thickens slightly, 5 to 10 minutes more. Taste and adjust the seasoning with salt and pepper.
For the cabbage: In a small bowl, combine the cabbage, cilantro and lime juice. Season with salt and pepper and toss to combine.
For the tacos: To each taco shell or tortilla, add 3 to 4 tablespoons of the spicy bean filling and some avocado slices and cabbage. Drizzle with 1 to 2 teaspoons Mexican sour cream. Serve immediately.
Roll the masa into twelve 1-ounce balls; cover them with damp paper towels.
Heat a heavy skillet over medium heat. Line a tortilla press with a piece of plastic wrap or a self-sealing bag that has been cut so that only the bottom is still attached. Put one of the dough balls slightly off center in the press and close to flatten. Carefully peel the tortilla from the plastic.
Cook in 30-second increments, turning a few times, until warmed through and lightly toasted. Keep warm wrapped in clean kitchen towels and repeat with the remaining masa, stacking and rewrapping the tortillas so that they steam and stay pliable.