The "usual" formula for standard error (SE) is:

SE = sqrt( (sigma^2/n) )

where sqrt means square root.

But if you have a finite population like N = 40 000 then you need to insert the finite population correction (fpc) fpc = (N-n)/N where N is the population size and n is the sample size. Then the SE is:

SE = sqrt( (sigma^2/n)*(N-n)/N )

Notice that when the population is large (like thousands) then the fpc will be close to one. (Like when N is 40 000 and n is 400). That means the you need essentially the same sample size even if you are investigating a small country like Luxemburg or USA or China. (And I guess that that is what was meant on twitter that Elon's lawyers are borderline statistically illiterate, because twitters population is very large. It is not the proportion of the population that matters, it is the sample size n that matters.)

But if you

@noetsi have a lot of subgroups, like counties or municipalities then you can do a stratified sample (i.e. a simple random sample from each municipality). If there are differences between the municipalities then you can gain (maybe a lot) precision by stratifieing.

Of course it is the sample size that you get back that matters.

BUT, but but! You have sent out a simple random sample (so that is OK) but you don't know if what you get back will be a simple random sample of those you sent out. So there can be a systematic bias in the sense that it is the more pleased customers or the more angry customers that responds. So, can you really rely on a sample survey with a low respons rate?