How to pass collation to UDF
Collations are database objects, so their name is an identifier.

You cannot use a parameter for an identifier, you'd have to use dynamic SQL in a PL/pgSQL function:

RETURN QUERY EXECUTE
   format(
      'SELECT ... COLLATE %I ...'
      text_collation
   );