A long config.txt turns into a pile of things I no longer remember adding. The firmware supports an include line, so display settings, overclock settings and the rest can live in their own small files.
include extraconfig.txt
Put that line in config.txt and the content of extraconfig.txt is inserted at that spot. On Raspberry Pi OS, config.txt itself lives in the boot partition at /boot/firmware/.
A simple layout could be one file for the screen and one for the board. Combined with the model filters, that gives you something like this:
[pi5]
include pi5.txt
[all]
include common.txt
The caveat is in the docs, and it is easy to miss. The bootcode.bin and EEPROM bootloaders do not support include. Settings that the bootloader handles only take effect when they are written in config.txt itself, not in an included file. The documented list is bootcode_delay, gpu_mem (with its 256, 512 and 1024 variants), total_mem, sdram_freq, start_x, start_debug, start_file, fixup_file and uart_2ndstage.
If a setting from an included file seems to do nothing, check that list first. Then run vcgencmd get_config int to see what the firmware loaded.
Further reading: config.txt documentation
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more