SEO | Cloaking | Is it safe to remove Third-party / Analytical scripts for crawlers/bots? Is this considered as cloaking?

Is it considered as cloaking if I remove third party scripts such as google tag manager, other analytics based scripts tags for crawlers/bots?

By removing these external javascripts I will surely have improved page performance(reduced page load time) for the Google Crawler and for effective SEO.

Though the question is related to Will disabling javascript be considered as cloaking by Google But, unlike there I am trying to remove only Third party Scripts which are not vital for the site from crawlers perspective.

Can I do so? Please suggest.