another question is: should we first implement CAST(expr AS type FORMAT 'template') for limited types (to_date, to_char, to_number, to_timestamptz) or first try to make it more generic?
That was my plan, essentially rewriting these into safe versions of the existing to_date/to_timestamp/etc functions, but much has changed since then, so while it still seems like a good intermediate step, it may be a distraction as others have stated elsewhere in the thread.