Themes, definitely not, that’s only Javascript, CSS & HTML.
Plugins: Kind of.
You can import Python modules into a Ruby (on Rails) based Discourse plugin and call Python functions using Pycall: GitHub - mrkn/pycall.rb: Calling Python functions from the Ruby language
I use it in Production for a very specific purpose as there is no equivalent module maintained in the RoR ecosystem so it avoids me having to translate and then maintain all that specialist code in Ruby.
It works surprisingly well.
That said, the base of that Plugin is still written in Ruby.
I would recommend you simply learnt Ruby on Rails as well - it really is a very pleasant language and imho the code is nicer to read than Python
I should also take the time to learn more Python if/when needs must.
Interesting side note: some of the code in Discourse Chatbot 🤖 (Now smarter than ChatGPT!*) that creates the agent behaviour was based on a Python agent called “Funkagent” which I first translated into Ruby on Rails (and then modified, enhanced.). So translation can be an option of course if it makes sense to do so. In that case it made sense.