PyUnicode_Replace

Replace at most maxcount occurrences of substr in str with replstr and return the resulting Unicode object.

Meta