assign color polygon python API
The mesh doesn't have to be fully covered with a material, but it does have to have material slots(at least two) if you want to be able to change individual parts. 

import bpy

obj = bpy.data.objects['Cube']
mat = bpy.data.materials['Red']
mat_slots = obj.material_slots
polys = obj.data.polygons

#add a material slot using a material
obj.data.materials.append(mat)

#remove material from material slot
mat_slots[0].material = None

#add the material slot that will be used for individual face
obj.data.materials.append(mat)

#apply material to one face
polys[0].material_index = 1