This simplifies code using these functions because of RAII, range based for loops, and the lack of output arguments. Also pass object pointer array as a span in more cases. Pull Request: https://projects.blender.org/blender/blender/pulls/117482