I’m of the opinion to not worry about it and just use the flags. It’s enough effort to properly internationalize a site and keep it maintained. That it’s available at all is a huge effort. Debating flags vs a drop down with languages is nitpicking IMO.
Plus, when the language codes include a country it’s a natural UI decision.
EDIT: Supporting multiple languages increases the complexity of the entire development pipeline. Translation teams are brought in, translation tools are brought in to support in-code language as well as translations in the database itself. Every new text snippet needs to be translated to each language to deploy it.
Your search features get more complicated, date formats, number formats, currency, collations. Every language you add increases this complexity. Because of that, you will represent a language with a primary country and not every language spoken in that country. On the chance that a company has opted to go all in to support region specific dialects of languages where 100+ choices will be listed, then no…of course flags wouldn’t work. But in most cases you’re lucky to get 2 languages at all with potential for a couple more for all but the largest of companies. Virtually every other site is just going to use one and churn out some Google translations or ask you to do that yourself.
After considering all that, yes…just use flags.