Create a compact meta format (AKA a DSL) for describing the function signatures and write a code generator which reads that meta-format and produces all of the needed headers and cpp files for the loadLibrary code. So you don't have to bother with the readability of the C or C++ code too much, just make sure your meta-format is well readable.