Good catch. This really shouldn't happen for bpchar as the trailing blanks are supposed to be ignored. I can see hashbpchar is doing it with the correct "true" length, so maybe this is a copy-and-pasteo from hashtextextended?
Also, does someone have an opinion on backporting this? I'm inclined to.
I'm not familiar with the backporting policy, but I also think we need to as this fixes an obvious oversight.