Presuming you have taken death off the table, what do you do as DM if the PCs are having a really hard time with some relatively unimportant or random fight and it looks like you are in TPK territory? Do you fudge to let them survive by the skin of their teeth? Do you have NPCs swoop in and save them? Do you have them all "knocked out" and wake up later? Do you apply some other penalty (permanent wounds, etc)?
I never fudge. Ever. I find fudging ruins the game for everyone involved, and have
extremely strong opinions about this subject--to the point that I'd rather not discuss it any further. Suffice it to say I never, EVER secretly pretend that rolls or statistics are different from what they actually are. I may
openly change things, in the sense of giving the player an open reroll, explicitly saying, "no that's BS, you just hit," or crafting an in-story reason why a creature's statistics change specifically so that the players have a chance to figure it out and understand what's happened.
As for the other methods: It all depends. Using
deus ex machina can be beneficial if you already had plans to offer powerful but somehow restrained allies (which I have done in the game I run)--the party actually spearheaded establishing an in-universe lifeline via one of those NPCs. Adjusting a fight by creatively applying the mechanics I built for it is another tool I have employed (not very often, as my players usually surprise me with novel strategies that just obliterate whatever I throw at them!) In that case, they were up against a force that had
both lots of small things and one big nasty, and the combo of the two meant they couldn't use their normal strategies to get out of the problem easily. (I had very intentionally tried to make a fight they WOULD have difficulty with, because I felt I wasn't challenging them enough.) After they spiked down the big nasty thing to near-death, I decided to creatively use its life-leeching move (this is DW, so creative use of moves is encouraged) to steal life
from its allies, significantly reducing the numbers advantage. Then it became a matter of "can you kill it before it runs away" rather than "can you survive." The party had fun and appreciated that they may need to take numbers disadvantages into account in the future.
I haven't used any of the other tools mentioned yet, but I certainly keep them on the table. I am also willing to let
some deaths happen, but have a follow-up adventure where the living work to restore the dead to life, and the dead work to be
ready for resurrection when that happens. Again, it's not death in an absolute sense I have a problem with: it is death that is both (a) unexpected AND (b) permanent that is a concern.