e.g. in Python, for both STLs and PLYs, I want to output a byte string rather than write directly to a file so I can use it in an API request.
E.g. something similar to vtk.vtkDataSetWriter()
writer = vtk.vtkSTLWriter()
writer.SetFileTypeToBinary()
writer.WriteToOutputStringOn()
writer.SetInputData(obj)
writer.GetBinaryOutputString()