Here's a routine I've stolen borrowed from pramsey's code and have been using ever since.
Could this be exposed in extension.h ? (probably without the version check)
I don't think this functionality is generally useful. Wrapping TypeGetTupleDesc(typoid, NIL) is very specific, and probably this code should be inside the extension.
Different question is API for searching in system catalog and dependencies. I can imagine some functions like
Oid extid = get_extension_id(extname);
Oid objid = get_extension_object_id(extid, schema_can_be_null, name, TYPEOID); // can be used for routine, table, ...