How to check if the active object is using no material
Get all the materials

materials = bpy.context.active_object.data.materials


Count the material slots

nMat = len(materials)


Check if a material slot is empty (in this case, the first slot)

isEmpty = not materials[0]