Currently, Number values can cause GetArg/ GetBoolArg to throw an exception, which most of the code isn't expecting (eg #24457).
AFAIK it isn't possible to normally get Numbers in settings right now, but that's expected to change with #15936 (which could create downgrading issues without this fixed), and in any case it isn't a great idea to randomly crash because of a logically-value settings.json value anyway.
This doesn't fix Get*Arg from throwing in the case it encounters an Array or Object. It's not obvious how to handle those scenarios. However, the functions touched are refactored to explicitly clarify that those scenarios will throw.
NOTE: Based on 0.20 branch-point, so a clean merge to everything newer. For testing, you will probably want to merge onto 23.x or master.