how to retain the ability to modify the post slug after applying a post_type_link filter?

One possible solution can be this one:

add_filter('wp_insert_post_data', 'update_post_data' , 10, 2);
function update_post_data($data, $postarr){
  if($data['post_type'] !== 'gallery') return $data;

  $data['post_name'] = wp_unique_post_slug(sanitize_title($data['post_title']), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent']);
  return $data;
}

This will auto-update the post slug upon updating the post. It works great as far as it’s ok for you to have the post slug mirroring the post title. Still, it’s not possible to manually edit the slug.
Also, in my case I’m doing it only if updating custom ‘gallery’ posts.