That would roughly be the cost of the deductible on an insurance policy you can buy that covers defense against intellectual property infringement (assuming infringement was not intentional). You can buy this sort of insurance. It's not cheap, but it can cover both defense costs as well as a certain amount of damages.
I'm expecting this to be common course for software companies in the near future.
It depends on the "troll." If you're Intellectual Ventures suing Microsoft over arguably legit patents, then you have put a lot of money into the case. But that's not "trolling" in the same way as in the X-Plane example, and it's arguably not something that needs any particular deterrence. There are valid economic arguments to be made in favor of NPE's in that context.
Th X-Plane case, however, is what I think most people on HN tend to be worried about. An entity coming at you with an obviously invalid patent, and going for volume: hoping to get a few hundred people to pay a few thousand in fees each hoping nobody will litigate. It doesn't cost anywhere near $50k to throw a quick, cut-and-paste lawsuit together.