Been thinking about it and there does appear to be legal ways to do this. First is have a Republican party win the presidency and also a majority in the house of Representatives. Turns out the speaker of the House - 2nd in line to presidency - does NOT have to be an elected member of congress. So a R majority can elect Trump to be Speaker. Then both President and VP resign and Trump becomes president til the end of that 4 year term. Or, same scenario and VP resigns and current president picks Trump to replace and then president resigns.
Eeks.
These are all very convoluted, though.
The first and easiest way the Supreme Court lets him do it is just declare that the 22nd Amendment refers to consecutive terms only.
This is, of course, contrary to the plain text and all indications of original meaning, but they have already shown they don't consider that important if it is in the way of what they want.
The VP idea that's been floated this way can also be done by just saying the 12th amendment text doesn't really apply here and the 22nd must be taken in isolation.
The Speaker of the House scenario is also the kind of thing that is so obviously in bad faith it
should be rejected but that the Supremes could decide to accept if it was convenient.