“All of the things mentioned above are quadratic complexity in terms of object count in the scene.”
Importing Disney’s Moana scene took three and a half hours. After fixing a handful of quadratic loops it takes 82 seconds, about 150 times faster. Nobody wrote slow code on purpose. Nobody tested with 260,000 objects either. Blender still crashes when it tries to display the result.