Well "H\xae\x97\x9eI\x00\x9dR\xb8E\xe8\xed7e6\xe4\xfa\x0eC\x01\xaf\xbb\xa8"\x85\xb36$\x94!\x10\x9f\xbc\xb9\xa5\xfbQnn\x9a%(\x05\xe0L\xac" is certainly not hexadecimal, hex digits are from 0 to 9, then from A to F. There are no special chars like %,( or $ ...
As for your problem:
string = "SD+ul55JAJ1SuCBF6O03ZTbk+g5DAa+7qCKFszYklCEQn7y5pftRbm6aJSgF4Eys"
hexString = ''.join(['\\'+hex(ord(i)) for i in string])
fp = open("file.txt", "w")
fp.write(hexString)
fp.close()