I think we can simplify this to just:

<pre>
 wstr = str.encode('UTF-16LE')
 wstr &lt;&lt; 0
 wstr.strip
</pre>