Hi, welcome and thank you for your question! I have changed your post’s title from to “Can I redefine a function in a package?” as the question guidelines recommend this:
Good titles are questions you would ask your friend about Typst.
I also added tags to make your question easier to find.
regarding your question, unfortunately there is really no mechanism for this. The package you use would have to explicitly support “replacing” that function (it would need to be passed as a parameter to the function(s) that should use it).