One small thing. The European Patent Office, which issues European patents, is nothing to do with the EU (beyond being in the same part of the world). It's not controlled by the EU, or set up by the EU, nor is its membership the same set of countries as the EU.
Joining or leaving the EU does not materially affect our status as members of the EPO. The new Unified Patent Court is something to do with the EU in that it has been set up for participating nations to have one place to litigate, rather than having to do it in each individual country. That's sensible enough on the face of it.
It _might_ make the troll problem worse (as a patent-specific court did in the US), or it might not. Avoiding the problem by making ourselves ineligible to use the court seems unlikely to help much. This is only useful if you don't want to sell anything outside the UK. As soon as you do you are subject to foreign patent courts. On the whole the UK patent office has been a helpful force within the EPO to keep it reasonably honest.
Software patents remain complete bollocks, and 80% of other patents are no better IMHO, but much progress has been made in the last few years to push back on the garbage and mostly things are not too bad in the EU, although we do have some egregious examples of how the system doesn't work (MS patent charges for FAT for example).
It remains to be seen how the UPC works out, but like all beureaocracies, you are better off setting the rules than just waiting to be affected by them. Indeed it was my experience campaigning against the evils of EU software patents 12 years ago, which led me to discover that the EU parliament is a lot more useful than the UK one when trying to reach reasonable conclusions over such divisive matters. I was actually quite impressed as how the place operated (and how much it was nothing like the cartoon portrayed in the UK media).