I found people are coming to this site (to an unrelated article) looking for a way to merge settings into an array.
You’re looking for
The main function for WordPress to do this is
wp_parse_args(). You likely want this function.
This is used for parsing shortcode options. It only supports defined arguments.