Q:

Is there a way to programmatically access an ArcGIS Pro project's default geodatabase? 

In the ArcGIS Pro workflow, one typically creates a project that is set up with its own file geodatabase. 
Is there a way to refer to this geodatabase generically in a python script? 
I have been poring over Esri's documentation and can't find anything on this. 
Essentially, I would like to do something like this:
fc_name = "some_name"
sr = arcpy. SpatialReference(4326)
out_fc = arcpy. CreateFeatureclass_management(*DEFAULT PROJECT FGDB HERE*, fc_name, "POINT", "#", "DISABLED", "ENABLED", sr)

How do I simply refer to *DEFAULT PROJECT FGDB HERE*? 
This would help me write tools where the user would be able to access the output in whatever project template they happen to have active. 

A:

Yes.  Use the defaultGeodatabase off the project:
p = arcpy.mp. ArcGISProject("C:\\PRJS\\project1.aprx")
p.defaultGeodatabase
'C:\\PRJS\\project1.gdb'

Alternatively you can make use of "CURRENT" as input to the ArcGISProject class when running the code from both the Python window and GP Tools (inside ArcGIS Pro itself). 
p = arcpy.mp. ArcGISProject("CURRENT")
p.defaultGeodatabase
'C:\\PRJS\\project1.gdb'

ArcGISProject class help reference

