Improve speed of `ndigits0z(::BigInt)` using logarithms (#8743).

(cherry picked from commit 5445e05e5ef47835d13496c2379b7edbdcf73cd6)

Conflicts:
	base/gmp.jl

From #8752
fix bug for getindex(::Number, ::Real)

(cherry picked from commit b718cbc72e90e28f8df514e1a320fc2eb4f9279c)