Do line/col to byte conversions on the python side rather than relying on vim.
Its calculations are off when text annotations are present:
- https://github.com/vim/vim/issues/5930
- https://github.com/vim/vim/issues/3718 (fixed, but vim 8.1 is still common)