I can get a map's view extent by doing this:
p = arcpy.mp.ArcGISProject('CURRENT')
m = p.listMaps()[0]
e = m.defaultCamera.getExtent()
However this is real janky because a user can move the map and re-run the code, and it doesn't update until the project is saved. This has been the case from what I can tell, for around five years now.
Maybe it's easier to explain what I need to do. In a script tool, I need to set the arcpy.env.extent parameter to "Same as display" but do it with python rather than forcing a user to manually select "same as display" in the GUI every single time.
Is there a "best practice" to implement this behavior in python? I had read that this property was made available to python sometime recently, but I can't find any documentation on it.