Another option is: stop writing code, instead sell your expertise in spotting the problems in advance.
In other words, become a Consultant.
Many organizations are happy to pay expensive dollars (if not top-dollar) for someone to spot the issues before spending months on creating the code that makes the problems. It is well known that fixing a bug in design, is orders of magnitude cheaper/easier than fixing it after it has been coded, tested, and deployed.
You won't be writing as much code, and you may likely miss that, but then it seems that the actual lines of code are not your core strength, but in knowing which lines of code should be written - and which shouldn't.
Focus on your strengths.
(well, if that's what you enjoy...)