Many[1][2][3][4][5][6][7][8][9] Linux distributions and package managers audit just-built binaries for non-relocatable absolute paths. If a binary contains a path /path/from/build/machine, it might not run on the end-user's machine.

The answer is no, at least when using GCC and targeting x86-64: you should not assume that string constants end up literally in the binary.

The answer is that GCC optimizes our std::string{PREFIX}. The fact that we see something that looks like the prefix is merely a coincidence.