SiteScripts/DefaultSiteExternalSharingCapability.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
  "actions": [
    {
      "verb": "setSiteExternalSharingCapability",
      "capability": "Disabled"
    }
  ]
}