This is a partial fix for T90535. This code was originally reviewed in D13297, but is now split into a separate patch, as suggested by Sybren in that review.
Added Material Name Collision USD import menu option, to specify the behavior when USD materials in different namespaces have the same name.
The Material Name Collision menu options are
Make Unique: Import each USD material as a unique Blender material.
Reference Existing: If a material with the same name already exists, reference that instead of importing.
Previously, the default behavior was to always keep the existing material. This was causing an issue in the ALab scene, where dozens of different USD materials all have the same name, usdpreviewsurface1, so that only one instance of these materials would be imported.
The issue can be reproduced with the attached file, materialNameCollisionTest.usda, which contains two USD Preview Surface materials,
/World/Materials/PreviewSurface and /World/Looks/PreviewSurface. These materials have different diffuse colors (green and red) and are each assigned to a mesh. Without the fix, both meshes are assigned the red material only.