Exactly -- check out script in the link, it shows how it would be used. I'm not sure why the first `remote_cmd` is called (probably local testing and forgot to delete it), so ignore that.
Try this and you'll see how it returns a dramatic amount of bash as its output:
Ah, makes sense! Yeah, that's nice. You can do something similar with scripting languages by piping source code into the interpreter. Super useful back in the day for doing crap on machines in an LSF cluster when the NFS was down/slow.
What does "export" mean in this context? Do you just mean `ssh host cmd` where cmd is some shell that happens to contain (and call) a function?