Sure some of the money went to R&D but the question is not can be it be used on a future telescope, it's will it be used?
I suspect if someone wants to launch another telescope today they would look at JWST and largely say they need to start over because it doesn't make sense to start with a 20-year-old design.
Take the sunshield - the huge tarp-looking thing that you always see below the telescope itself. My understanding is that this is critical for JWST to see in the deep infrared, since otherwise heat will interfere with the imaging. Probably a lot of money was spent on the development of this. But if that money had just been spent on 20 other telescopes, none of them would have been able to capture that part of the infrared spectrum that JWST will.
The power limit also requires that science data be downloaded with an experimental 26Ghz radio that only the three 100' diameter Deep Space Network dishes can receive. The projected science data download will require using the DSN for 8 hours a day, everyday for 5-10 years.
They should have started over using nuclear power and then they would have had a chance.
My calculations tell me this is not true for Mars though. The next time we do this, we should send it to the L2 of Mars.
(Of course the "dark side" isn't actually dark when the Sun hits it, so that would limit the available observing time.)
Edit: I just realized this idea comes from radio telescopes. Those would actually benefit from sitting on the far side of the moon, because that way they'd be shielded from the radio emissions of human civilization. That concept doesn't transfer to visible light or IR telescopes though.
The Earth might as well be as big as the Sun from the perspective of the IR instrumentation on JWT. They'd prefer to keep it entirely out of their field of view, which is why it's being positioned at L2. Placing the telescope on the far side of the moon would have the same effect at least part of the time, and we'd potentially be able to carry out maintenance and upgrades in the future.
I don't think there's any place in the solar system you can put things so that they won't be in the sun. If you're going to be in the sun anyway, better use it.
There is a broader point about space exploration in general here. The science that can be delivered by nuclear powered probes is well beyond that of solar ones. Higher instrument power, better comms, longer life, more predictable power supply. It's just better. There's one place in America that makes the plutonium for RTGs.
Plutonium is the ideal RTG fuel from an engineering point of view. But controlling and securing it jacks up the costs. What we need is lots of research into less-politically-fraught fuels. Americium is looking really promising.
https://en.m.wikipedia.org/wiki/Radioisotope_thermoelectric_...
At the low temperatures involved, Earth's night side puts out enough infrared radiation from its own heat to cause problems. JWST is all the way out at Sun-Earth L2 not for power reasons, but so that it will never be in a position where it needs to keep off heat from two different directions.
Nuclear does not help with this. In fact, by having a nearby penetrating radiation source and a high-temperature core mechanically connected to the spacecraft, it may be worse from a thermal perspective.
JWST is a strange spacecraft with very strange design constraints. Your intuitions about planetary/Earth-science or higher-frequency astronomy will not serve you well here.
Here is a good place to start: https://www.spiedigitallibrary.org/journals/Journal-of-Astro...
Yes, insulating an RTG from the IR sensors would have been a challenge, but one that could be completely and accurately tested on earth. The lack of sufficient power directly drove the passive cooling requirement. Which in turn drove the fraught 5 layer shield requirement - which has never been and can't be "Test as you fly" tested on earth.
The lack of power also drove the decision to use the experimental 26 Ghz Ka band downlink radio instead of a higher power and more robust X band radio.