People suggested inline , but this violates the very first part of your question, that is, it inflates the code, since the full definition is inserted into the code with every function call. Therefore, the answer to your general question is "No."
If you mark them as static , then they are still defined in each source file, as you correctly pointed out, but only once, and therefore a better option than inline if the code size is the only problem. I do not know if linkers, or are allowed, can specify duplicates and merge them. I do not suspect.
Edit
Just to eliminate any confusion as to whether I support the concept of using static and / or defining functions in header files, in the general case, be sure that I do not. It simply meant a technical response to the differences between the functions marked inline and static defined in the header files. Nothing more.
source share