How should I handle a large number of objects?
Blender supports Object Color to override the Material RGB Diffuse.


Object properties, set a color there (also possible via Python)
Link all Objects/Meshes with a single Material, with option Object Color set.