title: Fix a unicode string broken by (some) escaped backslashes
body: <p>I was looking at this question: <a href="https://stackoverflow.com/questions/50199840/python3-replacing-double-backslash-with-single-backslash">python3 replacing double backslash with single backslash [duplicate]</a></p>
  
  <p>and sifting through the responses to similar questions: <a href="https://stackoverflow.com/questions/5186839/python-replace-with">Python Replace \ with \ </a>, 
  <a href="https://stackoverflow.com/questions/647769/why-cant-pythons-raw-string-literals-end-with-a-single-backslash">Why can&#39;t Python&#39;s raw string literals end with a single backslash?</a>
  , <a href="https://stackoverflow.com/questions/22601291/how-do-i-unescape-a-unicode-escaped-string-in-python">How do I unescape a unicode escaped string in python?</a></p>
  
  <p>When I realised that none of the answers really solve this problem.
  Say I have a broken unicode string, it contains <strong>both</strong> escaped backslashes and escape characters:</p>
  
  <pre><code>my_str = '\\xa5\\xc0\\xe6aK\xf9\\x80\\xb1\\xc8*\x01\x12$\\xfbp\x1e(4\\xd6{;Z'
  </code></pre>
  
  <p>When I print it, some characters evaluate:</p>
  
  <pre><code>print(my_str)
  \xa5\xc0\xe6aKù\x80\xb1\xc8*☺↕$\xfbp▲(4\xd6{;Z
  </code></pre>
  
  <p>I can manually fix it like this:</p>
  
  <pre><code>my_str = repr(my_str)
  my_str
  "'\\\\xa5\\\\xc0\\\\xe6aKù\\\\x80\\\\xb1\\\\xc8*\\x01\\x12$\\\\xfbp\\x1e(4\\\\xd6{;Z'"
  my_str = my_str.replace('\\\\','\\')
  print(my_str)
  '\xa5\xc0\xe6aKù\x80\xb1\xc8*\x01\x12$\xfbp\x1e(4\xd6{;Z'
  </code></pre>
  
  <p>But at this point I have to manually copy and paste the result of print into a variable to finish the fix:</p>
  
  <pre><code>my_str = '\xa5\xc0\xe6aKù\x80\xb1\xc8*\x01\x12$\xfbp\x1e(4\xd6{;Z'
  print(my_str)
  ¥ÀæaKù±È*☺↕$ûp▲(4Ö{;Z
  </code></pre>
  
  <p>How do I do this without copying and pasting?</p>