If the website is essentially the same in every language but just translated then your proposed solution follows best practice and in reality it just means that instead of example.com showing up high in search results or having a reasonable page rank it would be
example.com/fr/ etc that show up and get the page rank. Functionally this solution works well for users since they can manually change the language code in the URL also and no cookie is required to remember their preferred language.
If the website is actually in essence a completely different website for each language, maintained from a different set of files, where it would not be uncommon for a page in one language to not have an equivalent in another language, then it might be better to use subdomains for the language codes, e.g.
https://fr.example.com/ and submit them all as separate websites with individual sitemaps into Webmaster Tools.
To have a redirection at the root-level of the domain is very common for large companies/organisations and often considered best practice for multi-language websites.
To give an example (and I realise Microsoft are not always a company to adopt industry best practice), if I (from within in the UK with English/British locale settings in my operating system), enter http://www.microsoft.com/ into my web-browser I am redirected to
http://www.microsoft.com/en-gb/index.aspx and if I enter microsoft into Google Search the top organic search result is for
Wikipedia is an example of a large site that has used subdomains since each language version of their website has a different base of content, though Wikipedia have a gateway/landing page with links to all their languages on the root level of the domain instead of redirecting a user based on locale settings or IP geolocation.