Motivation for the answer
I'll take a literary approach, aiming less at the surrounding historical context and more at an internal analysis of what "significance" the document's authors intended to convey.
However, rereading your question and David Robinson's comment, I see that you're not asking about this significance so much as the motivation to use "40" specifically. Thus, this answer doesn't directly address your question. But I do believe it provides an important foundation for an answer, because understanding the purpose a tool was used for helps understand the choice of tool.
Both Pieter and T.E.D. offer explanations of the choice of tool, and in that regard the answers will be more satisfactory. But the implied or stated purpose they are based on almost certainly misses the mark. I submit that both traditional and modern biblical scholarship would say it's unlikely that the purpose, the force of using "40" is to have an indeterminate number on hand. It certainly is not a euphemism (there is no social taboo to soften); it certainly is not due to the impossibility or awkwardness of inexpressing bigger numbers with precision or with vagueness (both are done often enough); and the biblical authors were not interested in de-nerding what is in fact a very nerdy document replete with specific numbers both large and small, particularly in the Pentateuch, where we find many of these same narratives that strategically use "40".
Some answers have suggested mathematical reasons for "40", computing percentages or aligning the numbers with other (supposedly) significant values. I find these anachronistic and atypical of biblical narrative structure.1
Pieter's and T.E.D.'s suggestions of a number system cutoff (or significant change) and of averaging out months or lifespans are more likely, more interesting, more basic motivations. But why did the writers (or the speakers of the language they used) look to natural or manmade phenomenon of around that size? Hopefully the discussion below concerning the function of "40" from the perspective of the document helps clarify what the tool is for for any other answerers.
We can make one observation in line with the previous answers, namely that it is almost certainly not a literal but a symbolic value.2 In that sense, it is indeed an "indeterminate" number in that one is not interested in the exact value.
But we can also make the observation that though it may stand for an indeterminate number, it's not exactly an "indeterminately large number" in the sense of "more than one would care to count". The Bible is well aware that 40 is too small a unit for such purposes, and for big, vague numbers it prefers rounded-off hundreds, thousands, tens of thousands, or even hundreds of thousands (Deut 32:30, Josh 23:10, 1 Chron. 12:14, Judges 15:16, Psalm 91:7, 1 Sam. 13:2, 2 Sam. 18:3, Lev. 26:8, 1 Sam. 15:4, Num. 11:21, NT Rev. 7:4, etc.). Hence, reading "gazillions" or even "umpteen" for the biblical 40 seems to miss the mark.3
So does 40 simply mean "an indeterminate small number"? Maybe. After all, it's probably around as small as you can get and still be indeterminate! But I think the Bible has a narrower use for it. There is indeterminacy, but that's not the force of the biblical use.
Significant block of time
One important note is that this number almost uniformly counts a period of time.4
When speaking of years, some instances: The Israelites wandered in the desert 40 years, with the explicit effect being that a whole generation died off (Num. 32:13). Moses fled Egypt at 40 years old (Acts 7:23) and returned 40 years after that (Acts 7:30). Some patriarchs married at 40, including Isaac (Gen. 25:20) and Esau (Gen 26:34). More than one king is said to have ruled for 40 years (e.g. 1 Sam. 4:18). In Jewish tradition, a person is allowed to study the Kabbalah at 40.5
When speaking of days, some instances: Noah's rain fell for 40 days and nights (Gen. 7:4); the spies explored Canaan for 40 days (Num. 13:25); Goliath taunted the Israelites for 40 days (1 Sam 17:16); Moses thrice spent 40 days and nights on Mount Sinai (Deut. 9:11, 9:25, 10:10); Elijah took a journey of 40 days to Mount Horeb (1 Kings 19:8). Embalming a corpse required forty days (Gen 50:3) — cp. your note on natron. In the NT, borrowing from this tradition, Jesus spends 40 days in the wilderness (Matt 4:2) and sticks around for 40 days after resurrection (Acts 1:3).
I would thus offer an interpretation for "40 years" as a single generation in the sense of having lived a full life (in ancient terms!): you are not just the nominal "adult" of your 12/13 years at bat mitzvah or bar mitzvah, but have lived the whole span that most adults enjoy and acquired a certain measure of wisdom and experience by doing so. This fits with the marriages mentioned above; 40 would be a rather old marriage in ancient times, but if it means "having accrued the fullness of age", it makes sense. (As a corrolary, your time is over and it's now your children's time.) It's a unit, a mini-epoch, a building block in a history or geneaology of a nation — which is the sort of thing the Bible is deeply concerned with, even symbolically.
Meanwhile, for "40 days" we can extend and miniaturize that meaning: it's a significant block of time within an average lifespan. We might say that 40 days is to a person's lifetime what 40 years is to a nation's history: a unit of time big enough to mark a change or a significant event.6
Wikipedia tells me this reading is corroborated by Michael Coogan.7
Other commentators, such as Ellicott in the 19th century, identified the number as one indicating "trial and patience", which fits well with the idea of a significant event (but doesn't agree with my focusing on a generation).
Meanwhile, the Pulpit Commentary (also 19th century) cites Trench that it's sometimes a "signature of penalty, affliction" and confession of sin, and other times a sign that "work is completely [and thoroughly] done".
These are widely accepted, established readings, in line with other commentators (except literalists who take "40" to be a precise value). I don't believe there are many who would say that the force or purpose of using "40" is to select an indeterminate number or to suggest that the exact value doesn't matter in a given context. Sure, it doesn't — but that's not the reason they chose "40".
To me these interpretations reinforce the idea of communicating a whole "unit" of time, whether that unit is characterized by trial or by simple "fullness".
1 When I talk about what the Bible "means" by the number I make no reference to supposedly hidden significance such as numerological or mystical interpretations.
2 There are at least three numbers that come up too often and at too useful a time to be coincidence: 7 / 70 (completeness; the root is related to "satiate"), 12 / 144 (traditional number of tribes of Israel, frequently recurrent), and of course 40. Some other lists include more, but the wider the net cast, the less compelling the explanation of function seems to become.
3 As someone who reads Biblical Hebrew daily, I should note that T.E.D. makes a mistake when citing the word רְבָבָה revavah. This word stems from the root רבב r-b-b meaning "to multiply, to become many", and is a good candidate for "indeterminately large number". Wiktionary and other dictionaries' gloss "10,000" does not refer to the "technical, literal value" of revavah but to precisely the figurative value "10,000" carried in early translations such as the KJV.
4 One exception is the number of se'ahs in a mikvah; this correspondence is only established by extrabiblical tradition.
5 Although, as the linked article notes, this appears to be only ambiguously supported by the Talmud.
6 In sacred matters, the Bible does sometimes use the metaphor of a person for a nation, particularly the Israelite nation.
7 Michael David Coogan, A Brief Introduction to the Old Testament: The Hebrew Bible in Its Context, Oxford, 2008, p. 116.