For those interested, the position with the bishop moved to f8 has been posted in the Shortest Proof Game thread, and tygxc has shortened the proof game to 25.5 moves.
Illegal Position Contest!
Rather than looking for an exact number, I'll go along with the one you worked out. What was it?
Assuming my mental arithmetic is correct (often risky) I make the answer you want 5190. I can post a proof if you like but that would be longer.
(I think the real answer, even if you limit positions to point where a move is made under art.4 and assume basic rules, is infinity of some order, but that discussion would probably be longer still.)

Assuming my mental arithmetic is correct (often risky) I make the answer you want 5190. I can post a proof if you like but that would be longer.
There's no need to post a proof--I won't be trying to contest it. I thought it could be a big number.

This is a common trick puzzle, because it appears in a semi-famous book, but is it possible for this position to be reached with white to move?
Nf3 e6 Ng1 e5
#5681
If the king is in double check, that means one check is a discovered check. This means it is a pawn that promotes to a queen with check while discovering a check from the second queen. That means a white pawn should be on the 7th rank, with the black king on one side and the white queen on the other side, both on the 7th rank. The white king then can be anywhere as long as he does not disturb the check. Like this:
Disregarding black/white symmetry and left/right symmetry, this leads to possibilities:
Pawn at b7
King at c7
Queen at a7
King at a7
Queen at c7
Queen at d7
Queen at e7
Queen at f7
Queen at g7
Queen at h7
Pawn at c7
King at b7
Queen at d7
Queen at e7
Queen at f7
Queen at g7
Queen at h7
King at d7
Queen at a7
Queen at b7
Pawn at d7
King at c7
Queen at e7
Queen at f7
Queen at g7
Queen at h7
King at e7
Queen at a7
Queen at b7
Queen at c7
Hence roughly 3 * 7 * 54 = 1134
I think you missed these kinds.
(and shouldn't there be a factor 2 in there for left right symmetry, even for a rough answer?)
#5685
Yes I missed the possibility of a capture.
Whether or not you multiply by 2 for left/right and/or by another factor 2 for black/white is a matter of convention. In table bases all 4 possibilities are treated as one entry.
Positions with captures of the 1st kind are equal to the rough value 1134.
Positions with captures of the 2nd kind are equal to 14*52=728
Hence 1134+1134+728= 2996 roughly
But I think tablebases also count illegal double checks as legal, so then even if by 'position' you understand equivalence classes of what 'position' always meant pre computer, the number of tablebase entries would be much higher. The difference in our estimates is now mainly the difference between old fashioned positions and equivalence classes of old fashioned positions.
I think most people would still say that the following two (you would say one) positions are equivalent but not identical, even though they may be represented by the same tablebase entry. In fact most people would probably be unaware of the fact.
When it comes to triple checks I think the situation would be different. Nalimov includes them but I think Syzygy marks them illegal.
In fact if you take the reported positions from syzygy-tables.info the number appears to be the number of equivalence classes times l! x m! x n!... where l, m, n ... are the numbers of repeated pieces of the same type and colour, so the factor of 2 would probably still appear in this case because of the two white queens.
I did specify KQQK, so even though a tablebase 'position' reresents also a pair of KKQQ positions the black/white symmetry wouldn't enter into it.
Why 52 and not 53 by the way?

The following position is illegal because there is no legal last white move (black to move)!
Of course there is a legal last move for white.
However, I'm not sure if that position is reachable. I suspect not, but am not sure.
The following position is illegal because there is no legal last white move (black to move)!
Oh, and this position IS legal, and here's a possible combination:
Seems to me the black pawns would have needed to take 10 white pieces to promote to 5 rooks and White still has 8 pieces on the board. Isn't he lucky?
The following position is illegal because there is no legal last white move (black to move)!
Of course there is a legal last move for white.
However, I'm not sure if that position is reachable. I suspect not, but am not sure.
Or just as in the previous post but with the board the right way up. Either penultimate right way up position is obviously legal.

Either penultimate right way up position is obviously legal.
Didn't you just argue the position is illegal?
We know Black is on the bottom, since the OP said so (Post #25). pauldrapier has a white pawn making a backwards capture.
If White were on the bottom, with either side to move, the position would be legal.
Yes I was a bit lazy in #5690.
I only these days post a proof game if there's some doubt about whether the position's possible.
(After getting in a couple of races with Rewan Demontay, except he didn't know he was in a race, because every time I came to post an improvement he'd already posted his own, which was usually an improvement on my improvement. So I thought sod this for a game of sowjers.)

With White on the bottom, side to move not specified, it's a pretty good shortest proof game challenge. I made one in 70 moves, but didn't try to make it shorter. I think I'll show it in the Shortest Proof Game thread.

Interesting position that looks realistic but is illegal.
Black's DSB could not have gotten to f4 as the original DSB, and no Pawns promoted, either.
#5660
This one looks illegal to me. If the white bishop on g8 were on f8, it would be a legal position.
but what about the other pawn? there are not enough captures to get the white pawn past the black ones to promote
What other pawn? Which white pawn past which black ones? What are you claiming?
oh nvm im an idiot just realised lol