Being a ghost means you can't attack people either, though you can still breathe fire and such.
If you don't have a flight gait you run the risk of being stuck in mid-air as the game spams time forwards kinda like being in a cage.
But you aren't fully invincible. Throw enough guys at once and you will get tired, then exhausted, fall unconscious, and eventually they will get a lucky hit in.
Yeah, no, literally the only way to do it would be throw enough guys that the game freezes when one of them tries to attack, and even then I've only actually seen it freeze if I tried to aim an attack at the same time dozens of them did.
Like here, I had to carefully jump out of the middle of this pile:
Not because I was worried about dying, but because if I didn't do it right the game would just freeze when I hit the 20+ foes swinging point and I attacked one.
Just like later, where some of them tried to break off and flee, I had to avoid getting surrounded, not because I could die, but because they could freeze me if 20+ foes tried to hit me while I was attacking one of them:
That is the only thing that slowed down the progression of fighting this army until the end:
They could never kill me, and many of these dudes were weapon masters using my steel+ wood templates for their gear.
This is well past the point where I'm worried about the things enemies can do, and running up against the literal limits of the game engine. If I bumped into these armies while I was moving around it just crashes the game to desktop, I tested it several times by trying to set up a way where I could end up getting ambushed by these dudes:
Even after cutting down on their number significantly, still no luck:
Had I bumped into them instead of leaving travel mode and letting them walk onscreen, it would crash every time.
Heck, these are modded elves who had various tweaks (and beards!) which I later disabled all hand-to-hand attacks from so they would only use their superior weapon/shield strikes (mostly because I wanted to just bash/hack them with my weapons to speed it up) and it was still a matter of "twenty or so simultaneous aimed attacks=freeze" as the only danger.