Scripted Copy of all Materials/Material slots from another Object
Copy only the active Material:

tgt.active_material = src.active_material


Clean copy of all Material Slots from src to tgt:

tgt.data.materials.clear() # ensure the target material slots are clean
for mat in src.data.materials:
    tgt.data.materials.append(mat)