New OBJ exporter is missing "Path Mode" setting for exporting .mtl files. The options that used to be available were: Auto, Absolute, Relative, Match, Strip Path, Copy. All of them are important. The new behavior (without any UI option to control it) curiously does not match any of the previous setting. New behavior is like "Relative, but to the source blender file, and not the destination export file".
Most of the previous logic was only present in Python based code (bpy_extras.io_utils.path_reference and friends). I searched whether something similar exists in the C++ codebase, but did not find anything -- none of the other C++ I/O modules have a need for something like that. So this meant that the python enum & path adjustment function & the texture copying had to be ported over to C++. That's the bulk of this commit.
For the obj test coverage, this changes the golden output of cubes_with_textures.mtl (which was previously "wrong"), and adds a new test to cover "relative" path mode setting:
Various other modes are hard to test using "golden" templates due to presence of absolute filesystem paths in the output. I tested all of them manually, and compared to previous python based exporter.