Vertex Paint For Multiple Objects in Blender 2.8
this answer is for vertex color of single object

I converted it to multiple objects:
import bpy
import random
import time
# start in object mode
objects = bpy.context.scene.objects
for obj in objects:
    
    mesh = obj.data

    if not mesh.vertex_colors:
        mesh.vertex_colors.new()


    color_layer = mesh.vertex_colors[&quot;Col&quot;]

    # or you could avoid using the color_layer name
    # color_layer = mesh.vertex_colors.active  

    i = 0
    for poly in mesh.polygons:
        for idx in poly.loop_indices:
            color_layer.data[i].color = (0, 1, 0, 1)
            i += 1
    # set to vertex paint mode to see the result
    bpy.ops.object.mode_set(mode='VERTEX_PAINT')