Why overloads need encoded names
C++ permits functions with the same source name and different parameter types, as well as names in different namespaces or classes. Encoding relevant names, types and scope lets linkage symbols distinguish those entities.
The Itanium C++ ABI specifies a grammar generally beginning with _Z, followed by name and type encodings. It is an ABI convention rather than a universal rule for every compiler and language; templates and special functions have additional forms.
References: [1]
Encoded information depends on context
In this ABI, an ordinary non-template function name does not encode its return type, whereas function types and some template contexts follow different rules. A mangled name is therefore not a verbatim complete declaration, and changing only a return type does not create an ordinary overload.
Functions with C language linkage and global-namespace variables have unmangled names under this ABI. C linkage constrains naming without automatically reconciling layouts, calling conventions or runtime differences across languages.
References: [1]
Readable display and compatibility limits
Tools can interpret an applicable mangling grammar to display more readable linkage errors, symbol tables or stack traces. Such demangling depends on known rules, not on breaking encryption; unrelated ABIs need not use the same grammar.
Compatible-looking symbols still require compatible class layouts, exception handling, runtimes and other ABI rules. Renaming a symbol alone cannot repair a binary-interface mismatch.
References: [1]