I take the point, and agree that games where corridors are always the optimal place to fight are boring, but a game where corridors are never the optimal place to fight because there are no corridors would also be pretty dull. And where do you go from there? Fighting with your back to a wall is always optimal so you take out all the walls? I would say that a lot of roguelikes would be improved by having significantly less corridors, but I wouldn't get rid of them entirely.
In the same way as everything else in a tactical game, you ideally want to make it so that fighting in a corridor is sometimes optimal and sometimes not. Fortunately, there are an absolute shit-tonne of mechanics you can employ to this end, some of which are so common as to be almost ubiquitous in Roguelikes anyway. Such as:
- The risk of getting trapped between two enemies
- Limited time to kite enemies back to corridors (hunger clock)
- Limited vision in corridors (darkness, corners)
- Enemies difficult to kite (ranged enemies, fast enemies, teleporting enemies, smart enemies, fleeing thieves)
- Area-of-effect abilities (spells, Brogue-like weapons)
- Bouncing spells (magic missile)
- Allies
- Different terrain types (water, high ground)
- Mana-/Stamina-limited abilities
- Reflecting explosions
- Dodging mechanics that require an empty space
- Barriers to retreating indefinitely (closing doors)
- And Many More!
Something I've not seen any roguelikes do but that might be quite cool would be to model the way that in Dark Souls and/or real life, you don't want to fight in enclosed spaces with certain weapons because of the difficulty of getting your swing on. An accuracy modifier based on your weapon and the number of wall tiles you're next to would be a pretty straightforward way of doing it, and may make the choice of where to fight a bit more interesting.