Get all materials in scene (Python)

Indeed the RenderMaterials table is the one you want.

Just 19 hours ago I posted a snippet where you can see how I loop over all materials:

In this specific script I pick with some extra conditions, but the simplest form to create a list with all materials is:

import scriptcontext as sc
rmats = [rm for rm in sc.doc.RenderMaterials]