How to assign random numbers to phase value for all noise F-Curves modifiers?
Explained in the inline comments:

import bpy
from random import random

# Only selected (thus visible), editable objects
# bpy.data.objects would affect all objects in all scenes!
for ob in bpy.context.selected_editable_objects:

    # OPTIONAL: Ignore object types other than mesh
    if ob.type != 'MESH':
        continue

    # Is there an animation?
    if ob.animation_data is not None and ob.animation_data.action is not None:
        action = ob.animation_data.action

        # Iterate over all F-Curves
        for fcu in action.fcurves:

            # Iterate over all F-Curve modifiers
            for mod in fcu.modifiers:

                # Only act upon Noise modifiers
                if mod.type == 'NOISE':
                    mod.phase = random() * 5