Since this problem is most probably not FreeBSD-specific, I filed a bug (209721) with hplip: https://bugs.launchpad.net/hplip/+bug/209721. The patch is attached there too. So my ordeal with this issue is finally closed.