In my experience, ArcPy seems to perform better with selecting features from very large feature services, compared to making feature queries via the ArcGIS API. With that, I have a script that performs a series of ArcPy feature selections using feature layer URLs and an area of interest feature class, like this:
selection = arcpy.SelectLayerByLocation_management(fl_url, overlap_type="INTERSECT", select_features=aoi_fc)
Problem is, I want to perform these selections using services hosted in an ArcGIS Online Organization that differs from my Licensing Portal Organization. I have an ArcGIS Online account with the desired organization, so I'm able to establish a connection via the ArcGIS API, but ArcPy access seems to be tied to a user's ArcGIS Pro license, not the API connection. Is there a way I can use ArcPy to select features from a service not housed within my Licensing Portal's Organization?