Fast access to bmesh verts/edges/faces from python?
One way to speed this up would be to use a Python list comprehension. It's probably not the exact answer you're looking for, but it may help with optimizing the code.