I've tried scripting the creation of groups by referring to this documentation (arcgis.gis module | ArcGIS API for Python)
Unfortunately, it seems like the documentation is incomplete and scripting seems impossible for the type of groups I'm trying to create where settings have to be done at the point of creation. e.g.

Not so critical are the group membership settings which can be updated (using scripts?) after the groups are created.

I do not know what the valid arguments are to certain parameters. Has anyone figured out how the parameters map to the configurations offered in Portal? If not, how do I find the information? Feeling somewhat let down knowing that the method with the likely implementation is there but it cannot be used because of the documentation.