If you limited the number of enemies bullets could travel through, I think you'd drastically lower the chances of the game crashing.
![](https://img.itch.zone/aW1nLzM3MjU0MzUuanBn/original/O2ZcET.jpg)
My game is very similar to this one. I spent at least 1/3 of the development time trying to stop the game from crashing due to exponential enemies spawning. I'm pretty sure my code is less efficient than yours, so I hope players lose before it becomes a problem!