You can apply a material override in the inspector, or using the following code:
# Create a new FixedMaterial (for example)
var new_material = FixedMaterial.new()
# Assign it on the mesh as an override
mesh_instance.set_material_override(new_material)
# Modify the material (it will be applied on all meshes you use it on, here only one)
# Note: if you need a texture or other setup, you may want to set more params
new_material.set_parameter(Material.PARAM_DIFFUSE, Color(0,1,0))