Realistically, most small companies can't afford to fight a large one over a patent infringement claim, regardless of the merits of the case.
It might be worth a couple of rounds of letters saying "we don't believe your claims to be valid", but if the aggressor continues into litigation, the legal fees can quickly become overwhelming. As in more than the defendant's business is worth.
Individuals writing open source software (such as compilers) have no chance, as most of them are not wealthy, and their personal assets are on the line.
If you're unluckly enough to be in the situation the parent describes, where an aggressor will keep coming for more if you capitulate on the first one, there's probably no way to win. Sometimes the rational action is a painful one: Completely shut down whatever it is you're doing, and find something else to do instead.
I'm familiar with projects that have shut down, some having been published and then (sadly) removed from public availability, over patent issues where it wasn't clear the aggressor's claims had merit, but they couldn't take the risk. Several in fields I wanted to work in.
The effect I see is development paused for a decade or two until it's safe to resume.
I suppose you might find a "no win, no fee" lawyer, but are those common in this situation?