With pure ArcPy the way to do this is to save a copy of the item's metadata to an XML file, modify it, then save the XML back to the original ArcGIS item. From the documentation:
Another approach is to use a Python script to update an item's
metadata content. The Python script must execute the same
geoprocessing tools as the model described above that processes
metadata using an XSLT stylesheet. The XSLT Transformation tool is
used first to save a copy of the item's metadata to an XML file using
the exact copy of.xslt stylesheet provided with ArcGIS Desktop. The
resulting XML file can be modified with a Python script. Then, the
updated XML document must be saved back to the original ArcGIS item as
its metadata using the Metadata Importer tool.
There is a 3rd party python library that automates this - Arcpy Metadata Editor (arcpy_metadata)
Note if using ArcGIS Desktop, these metadata tools are only available in 32bit Python (i.e. not the 64bit background geoprocessing python)