As dhag points out, you are recursively calling youyour function.
He rightly suggests you drop the backslashes and use command instead.
Additionally, the curly braces are not needed (but are allowed).
This is what my function would look like:
sha256sum () {
if [ -n "$1" ]; then
pv "$1" | command sha256sum -
else
command sha256sum --help
fi
}
A downside of this shell function is that you can't pass command line flags to sha256sum, or multiple input files.