Tests for hashes in scalar context (and hence HvFILL()).
Perl_hv_fill() can return early if the hash only has 0 or 1 keys.

No keys implies no chains used, so the return value is 0. One key
unambiguously means 1 chain used, and all the others are free. Two or more
keys might share the same chain, or might not, so the calculation can't be
short-circuited.
Cache HvFILL() for larger hashes, and update on insertion/deletion.

This avoids HvFILL() being O(n) for large n on large hashes, but also avoids
storing the value of HvFILL() in smaller hashes (ie a memory overhead on
every single object built using a hash.)