def METHOD_NAME(bindir):
    # Match a filename like these
    # godot.windows.editor.dev.x86_64.exe
    # godot.linuxbsd.editor.dev.x86_64
    #regex = r"godot\.(windows|macos|linuxbsd)\.editor(\.dev)?\.(x86_32|x86_64|arm64|rv64)(\.exe)?"
    prefix = "godot"
    os_prefix = ""
    suffix = ""
    if sys.platform == "win32" or sys.platform == "cygwin":
        os_prefix = ".windows"
        suffix = ".exe"
    elif sys.platform == "darwin":
        os_prefix = ".macos"
    else:
        os_prefix = ".linuxbsd"
    arch = ".x86_64"
    if platform.machine().lower() == "arm64":
        arch = ".arm64"
    if platform.machine().lower() == "riscv64":
        arch = ".rv64"
    # Names to try by priority
    names = [
        prefix + os_prefix + ".editor.dev" + arch + suffix,
        prefix + os_prefix + ".editor" + arch + suffix,
    ]
    for name in names:
        path = bindir / name
        if os.path.isfile(path):
            return path
    print("Error: Godot binary not specified and none suitable found in %s" % bindir)
    return None