Mesh's material_index is an index into what?
I am desperately looking for a scene-wide collections of materials, but I can't find it.


You want scene-wide materials?:

&gt;&gt;&gt; bpy.data.materials[:]
[bpy.data.materials['Material'], bpy.data.materials['Material.001']]


this shows the materials for one object:

&gt;&gt;&gt; bpy.data.objects['Circle'].material_slots[:]
[bpy.data.objects['Circle'].material_slots[0], bpy.data.objects['Circle'].material_slots[1]]


or

&gt;&gt;&gt; [m.name for m in bpy.data.objects['Circle'].material_slots[:]]
['Material.001', 'Material.002']




For completeness then

bpy.data.materials indices

For sake of argument I have a scene with 4 materials

&gt;&gt;&gt; bpy.data.materials[:]
[bpy.data.materials['MAT A'], bpy.data.materials['MAT B'], bpy.data.materials['MAT C'], bpy.data.materials['MAT D']]


We don't often need to get the material index in the materials collection, because we can use the name (a string) directly to get the reference.

&gt;&gt;&gt; my_material = bpy.data.materials['MAT D']
&gt;&gt;&gt; my_material.name
'MAT D'


If you really wanted to find the index of 'MAT A' in .data.materials, you could do a .find() because material names are always unique.

&gt;&gt;&gt; bpy.data.materials.find('MAT A')
0


data.materials is an indexed collection.

&gt;&gt;&gt; bpy.data.materials[0]
bpy.data.materials['MAT A']


material slot indices

The material_slots indices refer to the order in which your materials appear in the object's 'material stack'. 



&gt;&gt;&gt; obj = bpy.data.objects['Icosphere']
&gt;&gt;&gt; obj.material_slots[:]
[bpy.data.objects['Icosphere'].material_slots[0], bpy.data.objects['Icosphere'].material_slots[1]]


If you want a direct reference to the material in a slot:

&gt;&gt;&gt; obj.material_slots[:][0].material
bpy.data.materials['MAT A']


No need to get the name first, but if you wanted to:

&gt;&gt;&gt; obj.material_slots[:][0].name
'MAT A'


If the material_index is 1, and the object references two materials  (MAT D and MAT C), then 1 refers to MAT C and globally MAT C is index 2. It may be a point of some confusion that the term index is used to talk about the location of an item in two different types of collections.

Different Materials assigned to different faces (directly on mesh)

&gt;&gt;&gt; bpy.data.meshes['Icosphere.001'].polygons[42].material_index
0


this zero refers to the material slot index.

&gt;&gt;&gt; ico_mesh = bpy.data.meshes['Icosphere.001']
&gt;&gt;&gt; idx = ico_mesh.polygons[12].material_index
&gt;&gt;&gt; ico_mesh.materials[idx]   # get the reference
bpy.data.materials['MAT D']