BUG: improve log2 windows compiler fallback of log2

Fallback (similar to python3.4 math.log2) provides int(log(2**i)) == i
in default rounding mode.
Non-default rounding modes not tested but if it does not work we are at
least not worse than python.
Closes gh-4787
we don't really want to assure v has an integer value as that is not generally the case.
what we want here is check when the return value of log2 is cast to an integer it will be the expected integer as that is what e.g. indexing does.
at least in round-to-nearest mode this is true for a good log2 implementation with 0.5 ulp error (assuming python uses rounding mode aware integer conversion like rint)
our old (windows compiler only) fallback did not have this property as it had a too large error.

it is of course a very bad idea to base your program around this specific behavior of a log + int cast
I would not be surprised when this test fails on a bunch of platforms.