title: Batch string `replace`?
body: <p>Using system libraries, this would be very inefficient:</p>
  
  <pre><code>foo = "foo bar car haz can bar foo"
  repl = {('foo', 'bar'), ('car', 'bar'), ('foo', 'haz')}
  
  for rep in repl:
      foo = foo.replace(rep)
  </code></pre>
  
  <p>A replacement batch <code>replace</code> should solve this problem in O(|foo| + |repl|) rather than O(|foo| × |repl|) as in the above approach.</p>
  
  <p>Can you think of a concise way of implementing this more efficient solution?</p>