The problem, I believe, is the very open ended nature of the question that is at the end of your post
I'm relatively new to Python, and I've the feeling that there could be
a more efficient (and more pythonic) way to do what I want. How would
an experienced Python programmer solve this problem?
SO questions are typically about solving a particular problem. You haven't demonstrated that there is a concrete problem to solve. The only indication is that you "feel" there is a better way. Is there a need of a better way? If not, then SO probably isn't the best place for the question. Codereview or Programmers might be a better fit (not entirely sure, you would have to check yourself).
If there is a need, what is it? Is it not fast enough? Does it fail on huge input? Without a concrete problem with criteria that shows what you need, how will we know when it is solved? Will we just "feel" like it is done? And how will we know which answers are better than others with no criteria to measure them by? Cleanest code? Fastest? Most compact? Looks most like an ASCII unicorn in notepad? This feels like an opinion based question as every answer could be equally valid and there wouldn't be any objective standard to determine whether something was "better" than what you had.
In your case, it could be "I have this working code, but it isn't performant enough. I've tried X, Y and Z, and the performance has increased as shown in these benchmark tests, but that's not enough. What can I do?" (just a very rough example).
Also, not being a Python programmer myself, the term "more pythonic" sounds like a completely subjective standard to measure by and that might also be contributing. Maybe that means more to Python programmers, but I would be willing to bet that even amongst veteran Python programmers there would be some disagreement on what the "most pythonic" code would be.