IIRC, X870 boards are required to spend some of their PCIe lanes on providing USB4/Thunderbolt ports. If you don't want those, you can get an X670 board that uses the same chipset silicon but provides a better allocation of PCIe lanes to internal M.2 and PCIe slots.
> 1x PCI Express x16 slot (PCIEX16), integrated in the CPU:
> AMD Ryzen™ 9000/7000 Series Processors support PCIe 5.0 x16 mode
> * The M2B_CPU and M2C_CPU connectors share bandwidth with the PCIEX16 slot.
> When theM2B_CPU orM2C_CPU connector is populated, the PCIEX16 slot operates at up to x8 mode.
[1]: https://www.gigabyte.com/Motherboard/X870E-AORUS-PRO-ICE-rev...