mysql_real_escape_string() puts backslashes to these characters.
\x00, \n, \r, \, ', " and \x1a
The thing is, that if your binary output has backslashes it it's binary data, it can be very hard to fix. That being said, there is no magical function to undo this function.