Averaging all the images in a sequence

I’ve got a huge Cycles render that would have taken on the order of a month, nonstop, to render.
As I wished to be able to pause the process and be able to use or turn off my computer before it was done, I split the one 65536-sample render into 64 1024-sample renders, one per frame of a 64-frame “animation” where the only animated property was the Cycles seed value.

When the “animation” is done rendering, I mean to take the 64 images and average them together into what is, effectively, the 65536-sample render I was after. Now, I COULD do this with a huge tree of mix nodes in the compositor all linked to individual Image nodes, but before I attempt that, I’d like to know if there’s some more efficient/general way to do this. (Python methods would work, if you know of any.)

I would look for a star stacker app, that is another application that takes multiple exposures (of astronomy pics) and combines them for better resolution and lower noise.