Extra code on disk doesn’t cost anything (well disk space, but that is “free” for practical purposes). A compiler can arrange so that all of the code for a given architecture appeared consecutively in the binary, and then the pages and cachelines containing implementations unused by the processor on which you are running are never loaded into memory / never take up space in the cache.
Also, in practice code is a tiny portion of the size of a typical application. Far more space is consumed by resources like images and sounds.
Also, in practice code is a tiny portion of the size of a typical application. Far more space is consumed by resources like images and sounds.