Zend certified PHP/Magento developer

How to remove thousands of fake customer accounts?

I’m trying to remove all fake customer accounts, but first I need to unsubscribe them from my newsletter, I have around 600k fake accounts to remove, trying to run it via admin massive action I got the memory error below.

Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /data/www/new.test.ca/releases/20211007051948/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 291

Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /data/www/new.test.ca/releases/20211007051948/vendor/magento/framework/Model/AbstractModel.php on line 227

Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /data/www/new.test.ca/releases/20211007051948/vendor/magento/framework/Model/AbstractModel.php on line 227

Magento 2 fake accounts via bots

How could I unsubscribe them and remove them via a standalone script to run via CLI?