I found one solution. First save the original rotation of the camera. Then set the camera to look at the target (character). Now calculate the offset value and apply it every time after using the look_at() function. Here's the code.
check_only_once = false
cam_rotation_offset = camera_original_rotation-camera.rotation