The only way for a function name to be retained when building a new one through FunctionBuilder is to finish_module and then call set_fn_name through the module with the function's ID. Calling builder.set_name() does not get retained for some reason.