I like to use a dictionary for this:

    # This should go outside (preferably before) the function, but after all the basis functions are defined
    sph_harm_lookup = {None:real_sph_harm, "mrtrix":real_sph_harm_mrtri, "fibernav":real_sph_harm_fibernav}

    # This goes in the function
    sph_harm_basis = sph_harm_lookup.get(basis_type)
    if not sph_harm_basis:
        raise ValueError(' Wrong basis type name ')
    B = sph_harm_basis(m, n, azi[:, None], pol[:, None])