Issue with diagonal movement being faster even though all vector lengths are 1

Godot Version

4.7.2

Question

Even though I'm using a vector3 that's normalized moving diagonally either with holding left/right and forward/backward or looking diagonally is causing movement to be faster all normalized vector lengths are 1 and the one non normalized vector's length is the max speed. Here's the code(I pasted it instead of a screenshot as there's a lot of non movement related clutter in the function)

var direction : Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
var input_dir : Vector2 = Input.get_vector(“move_left”, “move_right”, “move_forward”, “move_backward”)

var wish_vel : Vector3 = direction * current_max_speed
wish_vel.y = velocity.y

if direction:
velocity = wish_vel

#get get_total_velocity returns: abs(velocity.x) + abs(velocity.z)
current_speed = get_total_velocity()

if current_speed < current_max_speed:
return

if !is_on_floor(): return

velocity.x = lerpf(velocity.x, wish_vel.x, 0.2)
velocity.z = lerpf(velocity.z, wish_vel.z, 0.2)

According to Pythagoras, combing two cardinal direction inputs(x=1,y=1) would create a vector with a length of 1.414 (41% faster than moving straight).

A quick glance at your code, it looks like the final velocity would not be normalized. But I could be wrong.

Why are you setting direction before input_dir?

In any case, print that vector to see if its indeed normalized.