Adding random noise to a mesh -- programmatically (bpy.ops.mesh.noise)
Ugh, found it:

bpy.context.active_object.active_material

bpy.ops.mesh.primitive_plane_add()
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.subdivide(number_cuts=subdivisions)

bpy.ops.object.editmode_toggle()
bpy.ops.object.editmode_toggle()

#mat = getOrCreateMaterial()  Does not work
mat = bpy.data.materials.new("Material")
mat.texture_slots.add().texture = getOrCreateTexture()  #works

bpy.context.active_object.data.materials.append(mat)
bpy.context.active_object.active_material = mat

bpy.ops.mesh.noise(factor=0.5)


Had to look in the C source code for clues.