How to unlink material from a mesh, with python script?
Unlink a Material

Remove the first material from the mesh.

import bpy
obj = bpy.context.object
obj.data.materials.pop(0, update_data=True)


Remove all materials.

import bpy
obj = bpy.context.object
obj.data.materials.clear()


Unlink Texface

This clears images for each face (active uv layer only)

import bpy
obj = bpy.context.object
for tf in obj.data.uv_textures.active.data:
    tf.image = None


This clears images for all UV layers

import bpy
obj = bpy.context.object
for texlay in obj.data.uv_textures:
    for tf in texlay.data:
        tf.image = None




Update: TexFace has been removed in Blender2.8