My homebrew features a whole lot of languages- and many of them are "secret" in the sense that they use a special mechanic to learn them. You can't learn a secret language unless you find a tutor who knows it, and spend a month learning it. I've also toyed with various ideas for making those languages immune to
Comprehend Languages or
Tongues, but haven't arrived at a method I really like yet- and in any case they rarely come up in game so it hasn't mattered much.
That said, the party Bard in my Epic game did take Polyglot at her earliest possible opportunity.
Most of the secret languages are the primary languages spoken by now-extinct races; since the languages are no longer in wide use they become what Umbran termed "forgotten." One case, though, is a special one, since the race in question brought down its civilization by opening a portal to the Far Realm and starting a global war- contemporaries who survived the war spent several decades eradicating all this race's writings they could find out of fear that somebody else would repeat the mistake. That one could be considered "forgotten" and "secret" simultaneously, since it's a sort of "forbidden knowledge" thing.
I've also gone beyond the usual sort of language ideas with some of my racial languages- my world features several intelligent races based on creatures that do not naturally communicate using sound, so why should the intelligent ones do any different? The octopi in my world's oceans use a language (actually a pair of languages, since the race has a "good half" and "evil half" sort of like the split between Drow and High Elves) based on gestures made with tentacles and changes to the colors and patterns on the speaker's skin. Other races can't directly speak this language without shapeshifting into an octopus-person, but they can learn to understand it and read the writing.
There is also an extinct race of ant-people (in the racial background it's hinted that their spirits might have created/become the Formians after the mortal race died) whose language was based on scent. Only the written portion could ever be learned or used by people other than the ant-race.
And finally, the plant-people use a language consisting of both sounds and scents, though the scent portion of the language has been falling into disuse as they interact more and more with other races (who, of course, use sound exclusively). Supposedly a group of professional spies among the plant-race is trying to create a language for their own use that is solely based on scent, but it hasn't happened yet in the current campaign timeline.