the move functions in KinematicBody such as move_and_slide()
have an stop_on_slope
argument, set it to true to enable it's functionality
this is from the documentation:
Vector3 move_and_slide(linear_velocity: Vector3, up_direction: Vector3 = Vector3( 0, 0, 0 ), stop_on_slope: bool = false, max_slides: int = 4, floor_max_angle: float = 0.785398, infinite_inertia: bool = true)