Something that leaps out to me as horribly wrong is that aliasing a builtin doesn't cause the config file to be "invalid". Doing anything else is just doing spooky things that are explained only several hundred lines into the man page by a single sentence.
Maybe better would be to choke on config lines that alias a builtin, and to print error messages before or after the output of each git command while the offending line(s) are present.
Further,
git config alias.pull "pull --ff-only"
should definitely be an error. Instead, git gladly makes the (no-op) confusing edit to your config file.