This is where something like VFSForGit [0] helps out. Instead of cloning the entire repo, it creates a virtual file system and fetches objects on demand. MSFT uses it internally for the Windows source tree (which now exceeds 300GB).
Introduced: https://devblogs.microsoft.com/devops/introducing-scalar/
Integration into Git: https://github.blog/2022-10-13-the-story-of-scalar/