I just wanted to come back and add a bit of an apology for my impatience here before. I didn't really fully understand how the physics engine worked, and having learned a lot more about it I now realise that edge colliders are probably the best solution here, and that I should have coded my enemy collisions differently to avoid being pushed through the edge colliders - as if the tilemap generated polygon colliders (or box colliders, or anything else), it'd actually have fared far worse, with the character probably being pushed right through the wall, potentially right out of the level.
The cause of my problems was my decision to ignore all collisions between the player and enemy layer when the player was damaged and flashing invincible, then re-enable them again, and sometimes the collisions were re-enabled whilst the player's collider was inside an enemy's collider, and the physics engine would decide that the best way to push the player out of that collider was through the edge colliders generated by the tilemap. So I basically re-programmed how the flashing invincibility (and enemy collisions in general) work, and now the edge colliders are perfectly sufficient.
As I mentioned before, I now realise that, in certain situations, this would have resulted in the player being pushed not just into a wall, but right through one, potentially all the way out of the level, if it had been done with polygon colliders or box colliders.
So apologies for my impatience, I thought it was the fault of the edge colliders.