In his 1725 work Principi Di Una Scienza Nuova (known in English as The New Science; link to the CUP modern edition), Giambattista Vico wrote that:
For Hebrew began and remained the language of a single God, whereas, although the gentile languages must have begun from a single god, the gentile gods proceeded to multiply so monstrously that Varro succeeded in counting a good thirty thousand of them among the peoples of Latium, a number that is scarcely exceeded by the number of words of settled meaning in the large vocabularies of today.68
68 See footnote 125, p. 96. This is probably a reference to Varro’s Antiquitates rerum divinarum, which is largely known through St Augustine’s discussion of Varro’s lists of gods. See City of God, III, 12 and VII, 6. While admitting that Varro enumerated a large number of gods, discriminating between the certain and uncertain, Augustine suggests that the number, though large, was exaggerated.
This reference of "thirty thousand gods" seems quite arbitrary to me, so I followed the footnote by retrieving relevant information in cited texts. I first went to Augustine's De Civitate Dei (EN), but I could not locate any explicit mentions of the number 30,000. Augustine did state that Varro enumerated the number of pagan deities, without mentioning any specific figure:
Quid est ergo, quod pro ingenti beneficio Varro iactat praestare se ciuibus suis, quia non solum commemorat deos, quos coli oporteat a Romanis, uerum etiam dicit quid ad quemque pertineat? (4.22)
What is it, then, that Varro boasts he has bestowed as a very great benefit on his fellow-citizens, because he not only recounts the gods who ought to be worshipped by the Romans, but also tells what pertains to each of them?
Quid ipse Varro, quem dolemus in rebus diuinis ludos scaenicos, quamuis non iudicio proprio, posuisse, cum ad deos colendos multis locis uelut religiosus hortetur, nonne ita confitetur non se illa iudicio suo sequi, quae ciuitatem Romanam instituisse commemorat, ut, si eam ciuitatem nouam constitueret, ex naturae potius formula deos nominaque eorum se fuisse dedicaturum non dubitet confiteri? (4.31)
What says Varro himself, whom we grieve to have found, although not by his own judgment, placing the scenic plays among things divine? When in many passages he is exhorting, like a religious man, to the worship of the gods, does he not in doing so admit that he does not in his own judgment believe those things which he relates that the Roman state has instituted; so that he does not hesitate to affirm that if he were founding a new state, he could enumerate the gods and their names better by the rule of nature?
Apart from the passages cited above, 6.2-9 discusses the issue more broadly. Yet it too lacks specific reference to the number 30,000.
I then went to an edited collection of Varro's Antiquitates Rerum Humanarum et Divinarum in the hope that I might find some missing clues. However, after hours of checking and cross-referencing, I was not able to detect a single mentioning of the figure 30,000.
Further research revealed that the reference was also used in a number of other early modern publications; for instance, it appears in A History of the Heathen Mythology (1806) and A Biblical and Theological Dictionary (1837); most recently, it also featured in The Ancient Quarrel Between Philosophy and Poetry (2011), which basically took Vico's reference as granted (p.131).
The idea of "thirty thousand gods" isn't just attributed to Varro, it is also frequently attributed to Hesiod. Theologia Reformata, Vol.2 (1713) in fact lists the following right after mentioning Varro through Augustine:
Eusebius tells us that Hesiod, the Great Herald of the Gods and Goddesses, reckoned thirty thousand of them, and that another Pagan Writer made that Catalogue much larger.
This likely refers to a passage found in his Works and Days:
ἀθάνατοι φράζονται, ὅσοι σκολιῇσι δίκῃσιν
ἀλλήλους τρίβουσι θεῶν ὄπιν οὐκ ἀλέγοντες.
τρὶς γὰρ μύριοί εἰσιν ἐπὶ χθονὶ πουλυβοτείρῃ
ἀθάνατοι Ζηνὸς φύλακες θνητῶν ἀνθρώπων:
οἵ ῥα φυλάσσουσίν τε δίκας καὶ σχέτλια ἔργα
ἠέρα ἑσσάμενοι, πάντη φοιτῶντες ἐπ᾽ αἶαν. (250-255)...and mark all those who oppress their fellows with crooked judgements; and heed not the anger of the gods. For upon the bounteous earth Zeus has thrice ten thousand spirits, watchers of mortal men, and these keep watch on judgements and deeds of wrong as they roam, clothed in mist, all over the earth.
I find Hesiod's "thirty thousand spirits" markedly different from Varro's (supposedly) enumeration of thirty thousand names of gods; however, I can't quite rule out the possibly that there was a confusion between the two.
Another possibility I've been considering is that Vico (and other early modern authors) might have access to manuscripts of Augustinian works with glosses and commentaries, and the number 30,000 was probably a remark added by later commentators that was taken for granted. Obviously this is all speculative, as I have no evidences to speak of at this point.
In short, I am still unable to find the source to the reference that "Varro enumerated 30,000 names of the gods"; it's rather clear that he did recount the deities, but where this particular number came from remains a puzzle that perhaps the History:SE community can shed light on.