In general, setting up a client with POP3 rather than IMAP will move all the emails from the inbox to the client. Once they are in the client you can decide how to backup the archive, there’s plenty of options with varying performance and memory footprint. That sounds pretty much like what you would like to do in general.
Just for completeness: That of course also means that syncing to several devices and backups are now your problems to solve.
In any case, the initial download will take a long time either way if you have 20+ years and 10s of GBs of data. No way around that.