## Bug description

strtobool is used in several places where it will cause deprecation warning in Pythin 3.10 and error in Python 3.12 since distutils will be removed in Python 3.12 .

Reference : https://www.python.org/dev/peps/pep-0632/

```
rg distutils                     
posthog/api/annotation.py
1:from distutils.util import strtobool

posthog/api/dashboard.py
2:from distutils.util import strtobool

posthog/api/insight.py
1:from distutils.util import strtobool

posthog/models/filters/mixins/common.py
4:from distutils.util import strtobool

posthog/settings.py
17:from distutils.util import strtobool
```

## Expected behavior

It's a good idea to vendor in the function as it's a short one.

## Environment

- [ ] PostHog Cloud
- [ ] self-hosted PostHog, version/commit: _please provide_


#### *Thank you* for your bug report – we love squashing them!

posthog/settings.py
"social_core.pipeline.social_auth.associate_by_email",
    "posthog.urls.social_create_user",
    "social_core.pipeline.social_auth.associate_user",
    "social_core.pipeline.social_auth.load_extra_data",
    "social_core.pipeline.user.user_details",
)
SOCIAL_AUTH_STRATEGY = "social_django.strategy.DjangoStrategy"
SOCIAL_AUTH_STORAGE = "social_django.models.DjangoStorage"
SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = [
    "invite_id",
    "user_name",
    "email_opt_in",
    "organization_name",
]
SOCIAL_AUTH_GITHUB_SCOPE = ["user:email"]
SOCIAL_AUTH_GITHUB_KEY = os.getenv("SOCIAL_AUTH_GITHUB_KEY")
SOCIAL_AUTH_GITHUB_SECRET = os.getenv("SOCIAL_AUTH_GITHUB_SECRET")
SOCIAL_AUTH_GITLAB_SCOPE = ["read_user"]
SOCIAL_AUTH_GITLAB_KEY = os.getenv("SOCIAL_AUTH_GITLAB_KEY")
SOCIAL_AUTH_GITLAB_SECRET = os.getenv("SOCIAL_AUTH_GITLAB_SECRET")
SOCIAL_AUTH_GITLAB_API_URL = os.getenv("SOCIAL_AUTH_GITLAB_API_URL", "https://gitlab.com")
# See https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DATABASE-DISABLE_SERVER_SIDE_CURSORS
DISABLE_SERVER_SIDE_CURSORS = get_from_env("USING_PGBOUNCER", False, type_cast=strtobool)
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
if TEST or DEBUG:
    DATABASE_URL = os.getenv("DATABASE_URL", "postgres://localhost:5432/posthog")
else:
    DATABASE_URL = os.getenv("DATABASE_URL", "")
if DATABASE_URL: