[bindings] Use references in a few places instead of pointers