a simple trick is to store knockback_velocity in a separate variable. then before you call move_and_slide() you can just add this knockback velocity to your existing velocity
and if you run something like knockback_velocity= knockback_velocity.move_toward(Vector2.ZERO, knockback_decay * delta) in addition you can make sure the knockback effect fades out