(wall material change node) Is is possible to make it more simply using python script?

Hi all!!

Using several dynamo nodes, I was able to change the material type from Air, Infilteration Barrier to Air.
By any chance, is it possible to make it more shortly using python script?

Thank!!