We could probably go further and replace functions with macros, but there is an issue with callers expecting status constants TM_ERROR_TIMEOUT, TM_ERROR_EBUSY etc.
We could define them using system constants.