Oh, this is cool! We'll need to check out this plugin mechanism as a thought for bectl -- it's fairly inflexible at the moment. libze_util_temporary_mount would be a good candidate for using (or being replaced by?) the recently-introduced zfs_mount_at in libzfs once that's widely available enough. That was a fairly trivial addition to libzfs that was initially made to support libbe's be_mount(), which previously used…
Thanks for the tip, the temporary mounting seems a bit like a hack so that's good to know there's a better option.