Yes. I attempted all of these. It didn't help. (The second proved ultimately impossible for me. I can't do that. It makes me feel gross. Being a selfish amoral prick in-game genuinely makes me feel awful IRL.)
There's a fairly big wide gap between "playing to survive" and "selfish amoral prick".
Mostly 1 with a dash of 2. As an example, we were jumped without warning by "bandits" when we tried to take a short rest after a previous fight that we barely survived. The DM never said a word about "bandits" being an issue, we had prepared for clearing out animals from the location (an abandoned, ruined temple IIRC), and somehow these bandits managed to jump us exactly during the hour we were resting so we started out with no resources. Oh, and the fight we'd barely survived (before the bandits) was the first combat after the DM threw a literal mummy (CR 3) at a party of five 1st-level characters, where we barely survived, and my character would have suffered instant death after a single long rest if the DM hadn't specifically given us divine aid. And that mummy fight was our second fight of the campaign. Oh, and because the bandits jumped us inside, they were between us and escape. The DM explicitly said he didn't understand why we weren't able to survive this. Needless to say, I haven't played any TTRPGs with that person again.
Please,
please tell me your party had a watch rotation going while you rested. 'Cause if not, getting jumped without warning seems about par for the course...
In almost every situation, it's a DM (often, but not always, a new one) thinking PCs are nearly unkillable regardless of level, throwing something wildly too strong or preventing any possibility of meaningful response to a previous knock-down, drag-out fight. So we either get absolutely curbstomped and thus every PC dies (usually within 3 rounds), or we barely survive one fight, only to get immediately jumped by a fight nearly as hard when everyone is a breath away from rolling death saves.
Yes, I have seen this happen not just more than once, but several times. Yes, it is infuriating every time and I legitimately tried my hardest to square this circle, to no avail.
That's where the DM has to be given space and time to learn from these mistakes as the campaign carries on (maybe with a brand new cast of characters if a TPK was involved).
If the DM doesn't learn and spends the next several months repeatedly wiping you all out then maybe it's time to pack it in and look for another game. Far more likely, though, is that after wiping you out once or twice the DM is going to swing too far the other way and throw nothing but puffballs at you for quite some time to come.
When it happens during the third or fourth fight you've ever had, what exactly is the party supposed to do? Why is the DM consciously throwing unwinnable fights before even letting the party level up once?
The level-up piece is IMO unrelated to any of the rest of this, never mind that after only three or four combats it's far too soon to even think about bumping.
As for why? Every DM is different, but it could be any or all of:
--- mistake: misreading or misinterpreting how the CR system works
--- mistake: trying to shoehorn a personal "cool scene" into the game before the PCs can handle it
--- mistake: not realizing the party is deficient in one or more key areas (e.g. no healer, or no front-liner, etc.) EDIT to add: going into the field with a big hole in your lineup is also a major player-side mistake
--- mistake: the DM has a specific "win condition" approach in mind that the players/PCs don't follow
--- unintentional: the DM understands the CR system but the system itself lets him down by undervaluing a monster
--- intentional: the DM is trying to set a gritty survival-first tone to the game
--- intentional: the DM is making it clear that rolls won't be fudged and punches won't be pulled
And that's just the DM side. The players also have a role to play (pun intended) in avoiding TPKs, in which the first and foremost element is to not face-charge everything you meet. Unfortunately, and sadly, the more recent editions seem to encourage players to do just this...