Is there any cleaner way to, say, only run the validation part of a type input function [...]
This pre-supposes that said type input function has a distinct validation phase as opposed to simply performing its parse and failing when it encounters something it cannot handle.
I would suggest you attempt to separate the non-context-aware stuff and the context-aware stuff into two separate phases; and only data that passes the non-context-aware tests would then be bundled up into the full CTE where you then check constraints and the like. The how is beyond me but this is an open source project so you have access to all of the relevant functions. How you would go about using them without having to invoke the engine I do not know but that seems like the only performant option since the PostgreSQL executor isn't designed to handle your usage pattern.
Without considerably more understanding of the how suggestions are difficult to make - even were I to know the innards of PostgreSQL and using C. Others more knowledgeable will likely chime in but I suspect that I'm pretty close to the mark on this one.
Yes, you could make a regexp-base validation library...but that screams "maintenance nightmare" to me. I'm doubtful such a thing already exists.
David J.