Strip `?` and trailing characters from URL extensions and basenames. This makes some install methods cleaner, and prevents staging of files with `?` in the name, as that is a weird character. Affects 2 formulae in core (though potentially externals will need to be fixed.)