Off the top of my head: http://codingame.com/ - They support a lot of languages, even Rust!
I also remember an old Java application where you would write AIs for dueling bots, but I don't recall the name.
The folks at https://codegolf.stackexchange.com/ also host several games like that, more often than not competitively, however, and not open-ended or "singleplayer" games. Most accept any language that can take stdin and print stdout.
Sounds like Robocode.
I played this like 17 years ago and to my most pleasant surprise, the project is still alive.
I'm sure there are other ports for other languages too. I'm pretty sure there's a Python one for one.
Probably because if it's going to be in the browser, they have to do a large chunk of the work in JS anyways
and of course, everything is JS these days
If you know python and had never written JS before, you could probably still play this with a bit of trial and error.