Block them.
I suggest looking into blocking malicious ASNs since you will (soon) realize that the attacks often come from the same conflictive networks.
Yes, I have quite a few small ASNs covered. But many of these Python hits are coming from Amazon and Microsoft servers. So I can’t block by ASN, only by a user agent.
Honestly, because these cloud providers have a free trial, attackers abuse that a lot. By blocking those ASNs, you won’t block legitimate bots if you allow them.
You can set up a firewall rule with the highest priority that allows cf known bots and expand that rule in the future if you find that CF doesn’t whitelist some bots you find legitimate.
This can’t be implemented in all scenarios; however, I’d give it a try if you can!