Perhaps now is a good time to recommend the ever-popular BFG to anyone unaware: https://rtyley.github.io/bfg-repo-cleaner/
Also my team's biggest repo is a 2.5 GB checkout but gitlab (self-managed) reports it as 185MB "files" and 353 MB "storage" (no CI/CD artifacts).
Similarly there's also git-filter-repo: https://github.com/newren/git-filter-repo
It's in Python so runs pretty much everywhere *nix out of the box.