How can I rename bones that have certain prefixes in their names in a script?
You can have so called key-value pairs by using a dict. Script quickly tested against Rigify:

prefix_dict = {
        "Bip01_" : "",
        "Neck01" : "Neck",
        "phy_anchor_Skirt_00" : "Pelvis",
        "spine" : "Custom",
    }

import bpy

C = bpy.context
obj = C.object

# Bone Lookup
for key_bones in obj.pose.bones.keys():
    # Check for all the keys in prefix dict
    for key_pre in prefix_dict.keys():
        repl_value = prefix_dict[key_pre]
        if key_bones.startswith(key_pre):
            # Bone found
            bone = obj.pose.bones[key_bones]
            # Rename the bone!
            bone.name = bone.name.replace(key_pre, repl_value)