### Godot version

v4.0.beta13.official [caacade56]

### System information

Windows 8.1

### Issue description

The `Unreachable code (statement after return) in function 'function_name()'` warning is given for functions that do not have unreachable code. The same code does not give this warning in v3.5.stable.official [991bb6ac7].

### Steps to reproduce

```
func warning(i: int) -> void:
  if i == 0:
    pass
  elif i == 1:
    return
  else:
    return
  print("yeah")
```

Removing either the `elif` or the `else` removes the warning.

### Minimal reproduction project

N/A; code in reproduction steps can be placed in any blank gdscript file to trigger the error.
ERR_FAIL_COND_V_MSG(p_node->type != Node::FUNCTION, false, vformat(R"("%s" annotation can only be applied to functions.)", p_annotation->name));
	FunctionNode *function = static_cast<FunctionNode *>(p_node);
	if (function->rpc_config.get_type() != Variant::NIL) {
		push_error(R"(RPC annotations can only be used once per function.)", p_annotation);
		return false;
	}
	Dictionary rpc_config;
	rpc_config["rpc_mode"] = MultiplayerAPI::RPC_MODE_AUTHORITY;
	if (!p_annotation->resolved_arguments.is_empty()) {
		int last = p_annotation->resolved_arguments.size() - 1;
		if (p_annotation->resolved_arguments[last].get_type() == Variant::INT) {
			rpc_config["channel"] = p_annotation->resolved_arguments[last].operator int();
			last -= 1;
		}
		if (last > 3) {
			push_error(R"(Invalid RPC arguments. At most 4 arguments are allowed, where only the last argument can be an integer to specify the channel.')", p_annotation);
			return false;
		}
		unsigned char locality_args = 0;
		unsigned char permission_args = 0;
		unsigned char transfer_mode_args = 0;
		for (int i = last; i >= 0; i--) {
			String arg = p_annotation->resolved_arguments[i].operator String();
			if (arg == "call_local") {
				locality_args++;
				rpc_config["call_local"] = true;
			} else if (arg == "call_remote") {
				locality_args++;
				rpc_config["call_local"] = false;
			} else if (arg == "any_peer") {