Thanks!
We narrowed it down to the redirect_canonical
filter.
It is enabled in wp-includes/default-filters.php
as a global filter, and the code for it is in wp-includes/canonical.php
.
It has changed in various ways from WordPress 4.4.2 to 4.5.
Luckily we don’t need the filter, as we do redirects like the www
version of our site at a higher level in the web server configuration.