Ticket #41: specialize encode for PyPy

Before:
    100000 loops, best of 3: 3.88 usec per loop

After:
    100000 loops, best of 3: 2.27 usec per loop