NetworkManager gives wwan0 DNS priority over wlan0
Problem
Network appears sluggish due to DNS being slow to resolve. DNS is slow to resolve because wwan0 DNS is taking precedence over the faster wlan0 network. If wwan0 has poor signal, then DNS resolution slows down as it must time out the wwan0 DNS queries before moving on to wlan0.
Specifically, NetworkManager is giving wlan0 connections a dns-priority of 20. Per https://wiki.gnome.org/Projects/NetworkManager/DNS the default priority if not set seems to be 100. The end result is that when wwan0 data is enabled, its DNS servers always take precendence over wlan0, even though wlan0 takes routing precedence.
The config files for wwan0 interfaces under /etc/NetworkManager/system-connections/ appear to be dynamic, or at least changes made to dns-priority to wwan0 files directly seem to be overwritten when the interface changes.
Complications From IPv6
This also produces a separate error in the case that wwan0 provides IPv6 but wlan0 doesn't. In that case, DNS queries will return (and prefer) IPv6 responses from wwan0, but may not be able to route to those addresses over wlan0. To the user this ends up looking like the network is down (web pages won't load etc) when in reality they are attempting to connect to an IPv6 address over an IPv4 network.
Desired Behavior
DNS priority matches overall interface priority. In this case, wlan0 has routing precedence over wwan0 so it should also take DNS precedence.
Steps to Reproduce
Connect both wlan0 and wwan0 to a network. Observe that wwan0 DNS servers appear first in /etc/resolv.conf.
Temporary Workaround
Disable wwan0 data when on WiFi connection.