You can exclude files by extension or filename modifying properties in the web.config file. Look at the documentation for the buildproviders element in web.config. You can add the extension and map it to the System.Web.Compilation.ForceCopyBuildProvider, or add the filename and use the System.Web.Compilation.IgnoreFileBuildProvider
The buildproviders section has the following structure:
<buildProviders>
<add />
<clear/>
<remove />
</buildProviders>
You can also exclude files or folders by modifying your project file. Within a PropertyGroup element, you can add ExcludeFilesFromDeployment and ExcludeFoldersFromDeployment elements to exclude the desired items.
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<ExcludeFilesFromDeployment>File1.aspx;File2.aspx</ExcludeFilesFromDeployment>
<ExcludeFoldersFromDeployment>Folder1;Folder2</ExcludeFoldersFromDeployment>
</PropertyGroup>
See the answers to this question for more details: Exclude files from web site publish in Visual Studio
UPDATE: In answer to the revised requirement that you be able to do this globally, across all projects and solutions, I'd suggest that you create a build target file that you could import into your project files. Within the target file, you can identify the file and folder exclusions you want to make.
To make it easier to deliver this build target to all of your solutions, you could create a NuGet package that contains the target file and modifies your .csproj files accordingly.
This is essentially the approach used by SlowCheetah to extend the web.config transform process to other .config files; the NuGet package delivers a custom .targets file that extends the build process.
The initial setup is an effort, but if you're supporting a lot of solutions or teams, it might be the best approach.