You’re exactly right with how to call the function. And yeah, supplying the data is good. That way you can re-use the function on different time series. Based on what you have here, I’d even remove the k argument and just define k = len(data) inside the function (as long as k always equals len(data)).
I’m sorry to say I can’t help with the other issue. I can only doing a fresh install into a new environment following the PyMC installation instructions on the wiki (right hand side, you can find instructions for linux/mac/windows) to test if it’s an environment problem or something else.
Also definitely switch from conda to mamba and use that to do the reinstall (if you haven’t already). You can just swap all the conda commands to mamba commands in the install instructions. I think the install guides used to explicitly recommend using mamba, but I don’t see that on the page now.