I’d look into how PyRevit does this directly - the code is open source. There are a few ways, but as far as I know they all rely on putting the document on the disc somewhere (a requirement due to the compression inherent to all Revit file types - they are a form of structured storage after all).
My guess would be opening the family document, saving to a temp file, getting the size of the temp file, and moving onto the next (overwriting the file each time) before eventually deleting the temp file.