Yes, that could help.
altfields is a helper method that takes a list of tuples and runs them through arcpy.AlterField_management() to rename them:
def altfields(inLayer, flds):
"""
Support function to alter fields
"""
for f in flds:
arcpy.AlterField_management(inLayer, f[0], f[1], f[1])
its use is something like:
altfields(yourlayer, [('DMSLat', 'latitude'), ('panel', 'firm_panel')])
'updateAddress' is the target featureclass that you want to join the other featureclasses to.
'subdivision' is the feature class that you want to join to the target featureclass.
Both of these are just variables pointing to featureclasses, which you'll change to match yours.
I see ESRI's example has changed and has improved some over the one tree example, but there is a lot of additional things happening in the example that is distracting from being able to clearly see how to make a field map.
If you want to rename the fields in the fieldmapping, you can do so by doing this:
fldMap = arcpy.FieldMappings()
... # map like fields and exclude fields you dont want
#-----------------------
# create specific mapped fields:
specificfldmap = arcpy.FieldMap() # create FieldMap object
# add the target featureclass and its field name that you want to map.
specificfldmap.addInputField(targetfc, 'targetfcfldname')
# add the joining featureclass and its field name that you want to map.
specificfldmap.addInputField(joinfc, 'joinfcfldname')
# get the outputfield object
specfldobj = specificfldmap.outputField
# set the desired outputfield name
specfldobj.name = 'newoutputfieldname'
# replace the outputfield object with the modifed version
specificfldmap.outputField = specfldmapobj
# add your fieldmap to your fieldMappings object
fldMap.addFieldMap(specificfldmap)
# proceed with using the fldMap
You can iterate over a list of tuples for this part if you know the fieldnames and what you want to be mapped to in the target featureclass.