The vcf.c bcf_hdr_read() and bcf_hdr_write() functions work only on a little-endian host — hlen is read/written assuming that the host and on-disk representations are the same.
(I have not audited the other BCF code, e.g., record reading/writing.)
See also bcftools/vcfconcat.c's naive_concat() which similarly reads hlen without accounting for endianness.