It sounds like it’s possible to build enhanced spatial definition queries using ArcPy:
ENHANCING THE ARCGIS PRO DEFINITION QUERY SPATIAL CLAUSE WITH ARCPY WITH A MULTI-LAYER GEOMETRY FILTER
Since spatial definition queries can only be configured using the UI, not with SQL, I’m wondering if it would be useful to have a “Python Definition” section in the definition query dialog to customize the spatial definition query. It would be similar to the existing SQL definition section for non-spatial definition queries.
There would be obvious trade offs; it would be confusing to define the non-spatial part of definition queries with SQL and the spatial part with Python. But it seems like a pretty powerful concept to customize spatial definition queries using Python, yet most people wouldn’t know that’s possible. So I’m wondering if this idea would be a way for users to fully utilize this functionality.