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
This doesn't ensure that `v` has an integer value, which I think is what is wanted. So maybe do
```
assert_equal(v, i)
```
instead.