Gluttons for punishment, or for self-realisation?
You talk about 40 years of learning as if it were some huge punishment, but the thing about a polyglot is that he or she has that as a hobby. Not many folk get paid for it. It relaxes them and fascinates them to learn languages and so they do it. The fact that some spend 40 years indulging this love is really no more remarkable than someone who spent 40 years over a lovely big garden.
More of less or less of more?
Whether it really is forty years or more or less depends on intensity of learning, committed time in an average week, choice of methods, choice of materials, how efficient the learner is at getting a lot of mileage from a vocabulary of only, say 2,000 words, and if the learner has chosen a lot of similar languages and all of them are similar to his native tongue, or if a person has chosen languages with little common grammar and few common lexemes, and even a very different phonology and alphabet to his or her own.
By the numbers
The minimum time to get to 20 lots of 2000 words (40,000 words) with a reasonable cover of 20 not totally dissimilar grammars is something like 4,000 hours, although it could be with more efficiency done in closer to 3,200 hours. Let’s go with the 4,000 and allow the learner a thousand hours of learning time a year. What’s the result? Just four years. You’re not getting massive fluency but a solid base in 20 similar languages. On the other hand another person might work leisurely and start at about the age of 14 when the bug often hits and suddenly at age 90 die of natural causes on a tricky piece of Javanese polite form. That’s 76 years of learning. Let’s take the average of 76 years and 4 years and we get your 40 years, so it’s a perfectly reasonable estimate, but you see how the mileage can vary.