Drupal only has one sanctioned mechanism for removing specific assets, regardless of the motivation for doing so.
For CSS:
hook_css_alter
For JS:
hook_js_alter
To remove all style and scripts except .info
style and script use below codes:
function hook_css_alter(&$css) {
$themes=list_themes();
foreach($css as $key=>$item) {
if (!in_array($key, $themes['yourthemename']->stylesheets['all'])) {
unset($css[$key]);
}
}
}
function hook_js_alter(&$js) {
$themes=list_themes();
foreach($js as $key=>$item) {
if (!in_array($key, $themes['yourthemename']->scripts)) {
unset($js[$key]);
}
}
}
If the theme/module is custom, then obviously you can just remove the offending code manually if that makes more sense.