  In bilayers of two-dimensional (2D) semiconductors with stacking arrangements
which lack inversion symmetry charge transfer between the layers due to
layer-asymmetric interband hybridisation can generate a potential difference
between the layers. When analyzed using crystalline density functional theory
codes, the related difference between vacuum energies above and below the
bilayer would contradict the periodicity of supercell boundary conditions.
Here, we resolve this constraint by two means: (a) by constructing a larger
supercell, including two mirror reflected images of the bilayer separated by a
further vacuum, and (b) by using a background dipole correction. We use both
methods to compare bilayers of transition metal dichalcogenides (TMDs) - in
particular, WSe$_2$ - for which we find a substantial stacking-dependent charge
transfer, and InSe, for which the charge transfer is found to be negligibly
small. The information obtained about TMDs is then used to map potentials
generated by the interlayer charge transfer across the moir\'e superlattice in
twistronic bilayers.
