title: How to escape special characters of a string with single backslashes
body: <p>I'm trying to escape the characters <code>-]\^$*.</code> each with a single backslash <code>\</code>.</p>
  
  <p>For example the string: <code>^stack.*/overflo\w$arr=1</code> will become:</p>
  
  <pre><code>\^stack\.\*/overflo\\w\$arr=1
  </code></pre>
  
  <p>What's the most efficient way to do that in Python? </p>
  
  <p><code>re.escape</code> double escapes which isn't what I want:</p>
  
  <pre><code>'\\^stack\\.\\*\\/overflow\\$arr\\=1'
  </code></pre>
  
  <p>I need this to escape for something else (nginx).</p>