You create a navigation map for a different type with the NavigationServer2D and set the map active. Then you switch the NavigationRegion2D and the NavigationAgent2D to use this new map.
var new_map: RID = NavigationServer2D.map_create()
NavigationServer2D.map_set_active(new_map, true)
$NavigationRegion2D.set_navigation_map(new_map)
$NavigationAgent2D.set_navigation_map(new_map)
You do that for every kind of agent type that requires a different navigation mesh . e.g. small, normal, and large agents. If you only want to exclude certain regions from being used you can use the navigation_layers bitmask on the path query or NavigationAgent, but as soon as you need different navmesh geometry for the agents you need different maps.