My Gmail was nearing the 15GB free tier limit. I tried a few things to try to pinpoint the largest emails to delete, from searching for large attachments to writing code to count emails by sender. The problem was there were no large emails, just many thousands of often daily marketing emails. Identifying and deleting emails from frequent senders proved quite labor intensive.
In the end, the simplest solution was the most effective. I searched for the word "unsubscribe", selected all results across all result pages, and deleted them. I searched my Trash for a few senders I wanted to make sure not to delete email from, moved them back to the inbox, and I was done.
Easy.
It also lists all transactions mail in one panel, so you can clear them at once if everything is checked, you can however use gmail to filter down the promotional and spam emails and clear them at once from desktop.
I initially thought of using python or something with SMTP, but it wasn't that feasible than how much mobile yahoo client helped me. I trimmed down 6 mailbox with over 20k mails each (one of them going over 43k), to around 40 mails on each.