Replace
does not change the original string, it only returns a new string.
Try this instead:
str = Regex.Escape(str);
str = str.Replace(@"\*", @"*");
str = str.Replace(@"\?", @"?");
You say that you see two backslashes, but there are not really two backslashes. The double backslash is just an escape sequence for the backslash in the string, but the backslash won't be escaped when doing the regex operation.
More about escape sequences:
https://msdn.microsoft.com/en-us/library/h21280bw.aspx[
^]
Whether you see two backslashes or not, depends on the way you display the string -- if you view it in the debugger, you'll see two backslashes. If you output the string using Console.WriteLine, you'll only see one.