def METHOD_NAME(
    new_config: ConfigDict, config_path: str, include_defaults: bool = False
) -> None:
    """
    Serialize the new config dictionary and overwrite the current config file.
    Note: this will delete all comments in the config!
    :param new_config: Config dictionary.
    :param config_path: Path to the config file.
    :param include_defaults: Whether to include values that are the same
        as their defaults.
    """
    new_config_data = serialize_config(
        new_config, config_format=True, no_shielding=True, include_defaults=include_defaults
    )
    with open(config_path, "w") as f:
        f.write(new_config_data)