The "?" marks are being used as "query code." It's a URL/Internet thing, and my guess is intentional.
What you might need to figure out is how your server can be configured to understand these "query codes."
Many years ago, I used query codes in my custom designed Flash Video player. In the URL, these query codes would be interpreted by my Actionscript and then pick the correct video to play. It was an interesting solution, and worked. But then, when all browsers could play mp4 files directly, I aborted my custom video player.
Adobe's ActionSript had a way to parse these more complex URLs. I am not a
java programmer, but my guess is that there are ways to parse URLs that contain query codes. Maybe someone else will know.
But Howard is correct, this has more to do with things on your server-side than with Moodle. For example, if you use something like
https://mydomain.com/home.html?xxx, I think your browser ignores the xxx. It is up to your server and web page to interpret the xxx and do something with it.
I might be way off on all of this, so consider my comments as just some ideas. Put "using url variables" into a Google search.
Nope, don't change core code, as Howard suggests.