I wonder if it would be useful to have an ArcGIS file type that’s kind of like a .LYR file, except you can view and edit the definition in a text editor. Or edit the definition text directly with Python.
For example, it might be a full blown SELECT query, with SELECT, FROM, and WHERE clauses. It could be thought of as an .SQL file for ArcGIS.
Maybe it would be similar to a query layer, except it’s a file, and works for all supported ArcGIS layer & table types. Not just enterprise geodatabase feature classes/tables.