What is the fastest way to create an array of objects through a script?
Add a cube, then apply an array modifier in each dimension, and finally separate each part.   

import bpy

bpy.ops.mesh.primitive_cube_add(enter_editmode=False, location=(0, 0, 0))
cube = bpy.context.selected_objects[0]
dimensions = [10, 10, 10]  # Rows, Columns, Levels

for i in range(3):
    mod = cube.modifiers.new('Array', 'ARRAY')
    mod.relative_offset_displace[0] = 0
    mod.relative_offset_displace[i] = 1.1
    mod.count = dimensions[i]
    bpy.ops.object.modifier_apply(modifier='Array')
bpy.ops.mesh.separate(type='LOOSE')  # Remove this line to keep all cubes in one object