> I want to programmatically backup my iCloud picture library to a second cloud.
Fastest is to get a mac and enable offline storage for Photos.app, then backup the resulting folder.
> what is the best way to bulk download your iCloud image library?
The best way is to use Photos.app on macOS and export the photos (full resolution). This is what I did a while back