I was careful in selectively rolling back revisions, but if you've committed changes unrelated to BPY mixed with BPY changes, I might have reverted those too, so please double check.
packing 2400 rectanges is about 38x faster.
Use the C implimentation in uvcalc_lightmap and uvcalc_smart_project
Blender.c - filename returning None raises errors with existing scripts, just return "" so string functions on the filename dont raise an error.