This change prevents zero-cost computation of hash functions on
unbound number of zero-length slices of data. The cost for each slice
is at least equal to the base cost of a memory operation, but could be
more for longer slices.
(cherry picked from commit 0a3a18744fe575c0cae66cf68abb5d3d12704565)