The character used for the bar in legacy math fonts has a different code in Unicode.
\documentclass{article}
\usepackage{fontspec}
\renewcommand{\hbar}{{\mathchar"AF\mkern-9mu h}}
\begin{document}
[$h$]
[$\hbar$]
\sbox0{$h$}\the\wd0
\sbox0{$\hbar$}\the\wd0
\end{document}

The difference in width is slightly more than 0.00004 millimeters, less than the difference with pdflatex
. The bar is a bit higher, though.
The standard definition for \hbar
is
\def\hbar{{\mathchar'26\mkern-9muh}}
and \mathchar'26
refers to the character in slot octal 26 (decimal 22) in math group 0 (the standard text font). This is the same character used for the macron accent, which in OpenType fonts is at slot 0xAF
. Depending on the font it can be higher or lower.
Note that Unicode has a special slot for the Planck constants
U+201E PLANCK CONSTANT
U+201F PLANCK CONSTANT OVER TWO PI
and unicode-math
will define \hbar
to select the latter.