I have used bleach pool tablets to aid in keeping them clean, filling the sea strainer with them, however they are pretty bad for the environment and they won't remove the shell, even if the barnacles are dead. With most modern sailboat thruhulls the strainer is not removable, so it's difficult cleaning and painting in there. I've even considered cutting away every other bar on the strainer to facilitate access, or grinding away the built in grills (strainers) on the outside and replacing them with the power boat strainers that do unscrew.
If you have a strainer outside, diving is the only way I know of, and it is time consuming and tedious work, using screw drivers and picks. Working from the inside it is quite possible to plug the thruhull completely, jamming shell and growth against and into the strainer on the outside of the thruhull.
I talked to the maintenance people at the Charleston Aquarium and they use ozone to keep their lines clean, but again it won't clean out the shell, only prevent growth.
A haul out is the best way. Moving to fresh water for a bit will kill what's alive, but again won't remove the shell.