Ton pointed out a big flaw in my method. The G.totface and G.totvert counters I used to size the vert and face lists, really only show the faces and verts in the current 3D window. If you have some other window active and try to render, this will probably crash.