Is there any function in the source engine I can invoke to read/write the mesh, the bone definitions and other data from/to a .mdl file or a data stream?
Nope. studioMDL is your only bet if you’re asking to compile something. in which case drag your QC onto it.
Ok, then I’ll write my own import/export functions with the information in imesh.h. Unless there’s a better way, that is.