The reason while \'s are doubled while saving the string to a file is that \x can be interpreted as a control character by the compiler. For example, \n means "new line" and \t means "Tab"; to simply print a backslash, you need to double it to distinguish it from other control codes.
If, \'s weren't doubled, when reading back a string you would get the error "unknown escape sequence \x": having it doubled, instead, the compiler should correctly interpred them and rebuild an exact copy of the original pathname, it's strange what you say about multiple double-backslahes in sequence.
In any case, I suggest you use the "raw" string read/write functions instead of the standard ones.