title: more efficient way to pickle a string
body: <p>The pickle module seems to use string escape characters when pickling; this becomes inefficient e.g. on numpy arrays. Consider the following</p>
  
  <pre><code>z = numpy.zeros(1000, numpy.uint8)
  len(z.dumps())
  len(cPickle.dumps(z.dumps()))
  </code></pre>
  
  <p>The lengths are 1133 characters and 4249 characters respectively.</p>
  
  <p>z.dumps() reveals something like "\x00\x00" (actual zeros in string), but pickle seems to be using the string's repr() function, yielding "'\x00\x00'" (zeros being ascii zeros).</p>
  
  <p>i.e. ("0" in z.dumps() == False) and ("0" in cPickle.dumps(z.dumps()) == True)</p>