Speedup in PDF export by switching from StringIO to cStringIO