Using a IMAP account that only downloads headers to the hard disk (due to both disabling offline folders in synchronization&storage and disabling global search/indexing) is your best solution if you have tens of thousands of messages in a folder because it adds the least overhead. Its also unaffected by the size of any of the messages.
With tens of thousands of messages in a folder you can't afford the time to go through them one by one. With a IMAP account you can use the quick filter toolbar to search for groups of related messages that you can delete without having to individually read them. The searching is done by the IMAP server, NOT by Thunderbird. That is important as it avoids the need to fetch the contents of all of the messages and build a search index beforehand in order to search all of the messages.
Another advantage is it avoids the potential problems of a POP account having a logjam if it can't download a message, and not being smart enough to report the error and skip over it to the next message.
I don't know the maximum number of messages that you can effectively have in a IMAP accounts folder (configured to only download headers) without the performance being unbearable but that limit is much higher with that configuration than with a POP account. Webmail can also handle having lots of messages (i.e. it scales well) but it normally doesn't have a user interface that is suitable for searching that many messages.
Don't overlook the possibility of using a virtual folder (aka saved search) with a IMAP account to break the inbox into chunks that you search in. A virtual folder doesn't actually move any messages, its just using smoke and mirrors to create a folder that acts as if it contains just the specified messages. For example you could specify the virtual folder contains all of the messages in the inbox that were sent from yahoo.com. Then use the quick filter bar to search among them to find groups of messages that you want to delete (such as all messages for a specific distribution list or on a specific subject). When you are done with that chunk you replace the virtual folder with another one and repeat.
http://kb.mozillazine.org/Saved_Search