forgot to export the digits function from Base [#2737].
fix ndigits0z(0,base) for generic bases and improve its performance.

Previously, this would return a digits count of 1 for zero when it
should return a digit count of 0 (hence the 0z in the name).

Once we've reduced n below the ndigits_max_mul threshold, we can
safely continue with the fast multiplication method for counting the
remaining digits, which speeds things up and simplifies the code.