Incidentally, I'd think the optimal way to store the position would be as follows:
Each square can be indexed with six bits (2^6 = 64)
Only those squares with peices need be included in a particular positions representation, at which point the only other peice of information is which peice. There are 12 types of peices (six of each colour) so this can be represented with a four bit number (2^4 = 16).
The ten bit combination of the two, then tells you which peice on which square.
A position would then be a collection of three to seven of these ten bit sequences (K vs K is trivial and not material in its contribution to the size) plus a capture of the signed integer indicating the number of moves to mate, and for which side. For this purpose we'll assume a signed word (+/- 32K).
Based on this, and the 140 TB figure for the Lomonosov tablebase, the absolute upper bound would be taken by assuming every position is as small as possible (three peices, or 30 bits -- we'll assume 32 since this is how it would end up being allocated) plus another 16 bits for the signed word meaning each position could be as small as 6 bytes (up to 12 bytes for positions with seven peices):
140 TB/6 bytes = 2.56552713 × 10^13
This does not take into account any storage dedicated to the overcome the inherent difficulty that this scheme would have indexing these for fast lookup in order to present the position and legal subsequent positions on the fly as described above, and also assumes every position is only three peices and so as a result represents the absolute upper bound for a seven peice tablebase.
Four. Maybe even five.