You can export all your photos as unmodified originals using the export command on MacOS Photos. If you have a lot of photos, it's going to take a while, but that's how I'd attempt to do it. Might want to do it in batches, because you may run into errors, and that way you don't have to restart the entire process each time, or try to figure out where it failed and have to go and manage duplicates and the like.