yeah i just dont see how there is any practical concern to that. i know it "feels" ugly, but thats what ORMs do (all of them). the ORM is explcitly a tool to instrument business objects with persistence logic.
yes this is a common thing among architectural communities. The simple answer is that these model objects would have to have nothing to do with the SQLAlchemy ORM period if you want your business model to have absolutely zero linkage to the persistence details. The _sa_class_state and _sa_instance_state is the least of your problems, SQLAlchemy ORM applies instrumented descriptors to your classes as well. that's the whole way that things like MyModel.column has SQL behavior, how "my_model.column" has data in it, how "my_model.list_of_related" has related objects, etc. your business methods on those classes then build off of those attributes, which means those objects are fully dependent on the ORM.
the standard way to architect for this pattern is to treat SQLAlchemy ORM objects as specific to persistence, then have an entirely different copy of the whole model as actual business objects. Then you have a data persistence layer that runs queries in terms of ORM objects and can translate them to your data objects. This is the pattern I would recommend; by trying to use special instrumentation tricks, you're trying to temporarily apply ORM instrumentation to objects that you otherwise would prefer have nothing to do with the persistence, and that's just wrong; these objects will have *everything* to do with persistence while this process goes on.
the above pattern is the one that is used by most of the Openstack projects, for example, though they have steadily moved away from it due to it being cumbersome. The pydantic project offers a standard recipe for this kind of thing which you can see at
https://pydantic-docs.helpmanual.io/usage/models/#orm-mode-aka-arbitrary-class-instances , where you have your dataclasses on one side and your persistence /ORM objects on the other. people are usually pretty annoyed by this pattern so the SQLModel project
https://github.com/tiangolo/sqlmodel aims to simplify this by re-joining the two types of objects together, but in this case if you are going for "purity" I dont think you can get around that you will need to have two parallel object models and a data access layer in between.
not at all! I know exactly what you're going for, and that's great. you will need to have two separate layers though, trying to sneak by with temporary instrumentation is not the way to do that.