diff --git a/pydantic/main.py b/pydantic/main.py
--- a/pydantic/main.py
+++ b/pydantic/main.py
@@ -248,7 +248,12 @@ def __new__(mcs, name, bases, namespace, **kwargs):  # noqa C901
                 class_vars.update(base.__class_vars__)
                 hash_func = base.__hash__
 
-        config_kwargs = {key: kwargs.pop(key) for key in kwargs.keys() & BaseConfig.__dict__.keys()}
+        allowed_config_kwargs: SetStr = {
+            key
+            for key in dir(config)
+            if not (key.startswith('__') and key.endswith('__'))  # skip dunder methods and attributes
+        }
+        config_kwargs = {key: kwargs.pop(key) for key in kwargs.keys() & allowed_config_kwargs}
         config_from_namespace = namespace.get('Config')
         if config_kwargs and config_from_namespace:
             raise TypeError('Specifying config in two places is ambiguous, use either Config attribute or class kwargs')

diff --git a/tests/test_main.py b/tests/test_main.py
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -7,6 +7,7 @@
 import pytest
 
 from pydantic import (
+    BaseConfig,
     BaseModel,
     ConfigError,
     Extra,
@@ -1734,3 +1735,14 @@ class Model(BaseModel, extra='allow'):
 
             class Config:
                 extra = 'forbid'
+
+
+def test_class_kwargs_custom_config():
+    class Base(BaseModel):
+        class Config(BaseConfig):
+            some_config = 'value'
+
+    class Model(Base, some_config='new_value'):
+        a: int
+
+    assert Model.__config__.some_config == 'new_value'

`BaseSettings`-specific configuration cannot be passed to class as keyword arguments
### Checks

* [x] I added a descriptive title to this issue
* [x] I have searched (google, github) for similar issues and couldn't find anything
* [x] I have read and followed [the docs](https://pydantic-docs.helpmanual.io/) and still think this is a bug

<!-- Sorry to sound so draconian, but every second saved replying to issues is time spend improving pydantic :-) -->

# Bug

Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
             pydantic version: 1.8.1
            pydantic compiled: False
                 install path: [...]/lib/python3.9/site-packages/pydantic
               python version: 3.9.2 (default, Feb 21 2021, 06:38:26)  [Clang 7.1.0 (tags/RELEASE_710/final)]
                     platform: macOS-10.14.6-x86_64-i386-64bit
     optional deps. installed: ['typing-extensions']
```
<!-- or if you're using pydantic prior to v1.3, manually include: OS, python version and pydantic version -->

<!-- Please read the [docs](https://pydantic-docs.helpmanual.io/) and search through issues to
confirm your bug hasn't already been reported. -->

<!-- Where possible please include a self-contained code snippet describing your bug: -->

The `BaseModel` metaclass ignores configuration settings specific to `BaseSettings` when these are passed as keyword arguments during class creation.  They are passed on to `ABCMeta` which does not accept keyword arguments:

```py
import pydantic

class Foo(pydantic.BaseSettings, env_prefix='BAR_'):
    pass

```
Output:

```
Traceback (most recent call last):
  File "[...]/foo.py", line 3, in <module>
    class Foo(pydantic.BaseSettings, env_prefix='BAR_'):
  File "[...]/lib/python3.9/site-packages/pydantic/main.py", line 361, in __new__
    cls = super().__new__(mcs, name, bases, new_namespace, **kwargs)
  File "/nix/store/cdifcrgj5phbvspzs02yglz35qql4i1x-python3-3.9.2/lib/python3.9/abc.py", line 85, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
TypeError: Foo.__init_subclass__() takes no keyword arguments
```

tests/test_main.py::test_class_kwargs_custom_config
tests/test_main.py::test_success tests/test_main.py::test_ultra_simple_missing tests/test_main.py::test_ultra_simple_failed tests/test_main.py::test_ultra_simple_repr tests/test_main.py::test_default_factory_field tests/test_main.py::test_default_factory_no_type_field tests/test_main.py::test_comparing tests/test_main.py::test_nullable_strings_success tests/test_main.py::test_nullable_strings_fails tests/test_main.py::test_recursion tests/test_main.py::test_recursion_fails tests/test_main.py::test_not_required tests/test_main.py::test_infer_type tests/test_main.py::test_allow_extra tests/test_main.py::test_forbidden_extra_success tests/test_main.py::test_forbidden_extra_fails tests/test_main.py::test_disallow_mutation tests/test_main.py::test_extra_allowed tests/test_main.py::test_extra_ignored tests/test_main.py::test_set_attr tests/test_main.py::test_set_attr_invalid tests/test_main.py::test_any tests/test_main.py::test_alias tests/test_main.py::test_population_by_field_name tests/test_main.py::test_field_order tests/test_main.py::test_required tests/test_main.py::test_mutability tests/test_main.py::test_immutability[False-False] tests/test_main.py::test_immutability[False-True] tests/test_main.py::test_immutability[True-True] tests/test_main.py::test_not_frozen_are_not_hashable tests/test_main.py::test_with_declared_hash tests/test_main.py::test_frozen_with_hashable_fields_are_hashable tests/test_main.py::test_frozen_with_unhashable_fields_are_not_hashable tests/test_main.py::test_hash_function_give_different_result_for_different_object tests/test_main.py::test_const_validates tests/test_main.py::test_const_uses_default tests/test_main.py::test_const_validates_after_type_validators tests/test_main.py::test_const_with_wrong_value tests/test_main.py::test_const_with_validator tests/test_main.py::test_const_list tests/test_main.py::test_const_list_with_wrong_value tests/test_main.py::test_const_validation_json_serializable tests/test_main.py::test_validating_assignment_pass tests/test_main.py::test_validating_assignment_fail tests/test_main.py::test_validating_assignment_pre_root_validator_fail tests/test_main.py::test_validating_assignment_post_root_validator_fail tests/test_main.py::test_root_validator_many_values_change tests/test_main.py::test_enum_values tests/test_main.py::test_literal_enum_values tests/test_main.py::test_enum_raw tests/test_main.py::test_set_tuple_values tests/test_main.py::test_default_copy tests/test_main.py::test_arbitrary_type_allowed_validation_success tests/test_main.py::test_arbitrary_type_allowed_validation_fails tests/test_main.py::test_arbitrary_types_not_allowed tests/test_main.py::test_type_type_validation_success tests/test_main.py::test_type_type_subclass_validation_success tests/test_main.py::test_type_type_validation_fails_for_instance tests/test_main.py::test_type_type_validation_fails_for_basic_type tests/test_main.py::test_bare_type_type_validation_success tests/test_main.py::test_bare_type_type_validation_fails tests/test_main.py::test_annotation_field_name_shadows_attribute tests/test_main.py::test_value_field_name_shadows_attribute tests/test_main.py::test_class_var tests/test_main.py::test_fields_set tests/test_main.py::test_exclude_unset_dict tests/test_main.py::test_exclude_unset_recursive tests/test_main.py::test_dict_exclude_unset_populated_by_alias tests/test_main.py::test_dict_exclude_unset_populated_by_alias_with_extra tests/test_main.py::test_exclude_defaults tests/test_main.py::test_dir_fields tests/test_main.py::test_dict_with_extra_keys tests/test_main.py::test_root tests/test_main.py::test_root_list tests/test_main.py::test_root_nested tests/test_main.py::test_encode_nested_root tests/test_main.py::test_root_failed tests/test_main.py::test_root_undefined_failed tests/test_main.py::test_parse_root_as_mapping tests/test_main.py::test_parse_obj_non_mapping_root tests/test_main.py::test_parse_obj_nested_root tests/test_main.py::test_untouched_types tests/test_main.py::test_custom_types_fail_without_keep_untouched tests/test_main.py::test_model_iteration tests/test_main.py::test_model_export_nested_list tests/test_main.py::test_model_export_dict_exclusion tests/test_main.py::test_custom_init_subclass_params tests/test_main.py::test_update_forward_refs_does_not_modify_module_dict tests/test_main.py::test_two_defaults tests/test_main.py::test_default_factory tests/test_main.py::test_default_factory_called_once tests/test_main.py::test_default_factory_called_once_2 tests/test_main.py::test_default_factory_validate_children tests/test_main.py::test_default_factory_parse tests/test_main.py::test_none_min_max_items tests/test_main.py::test_reuse_same_field tests/test_main.py::test_base_config_type_hinting tests/test_main.py::test_allow_mutation_field tests/test_main.py::test_inherited_model_field_copy tests/test_main.py::test_inherited_model_field_untouched tests/test_main.py::test_mapping_retains_type_subclass tests/test_main.py::test_mapping_retains_type_defaultdict tests/test_main.py::test_mapping_retains_type_fallback_error tests/test_main.py::test_typing_coercion_dict tests/test_main.py::test_typing_coercion_defaultdict tests/test_main.py::test_class_kwargs_config tests/test_main.py::test_class_kwargs_config_and_attr_conflict