替换Golang标准软件包并在其中调用原始软件包

Assume that there is a special hardware that can make certain standard library functionality faster.

Hardware might be present or not.

I can write a package that would utilize this hardware with the same function signatures as in the standard one, but it will force all the applications and other packages to decide which package to import based on the availability of the hardware on the specific target. At build time and with code modifications in all the applications and packages.

Ideally, I would prefer to make the decision of which package to use at runtime and without requiring applications to change their imports.

The package would check for the availability of the hardware and would either use it or execute standard functionality instead.

Is there any way to achieve it?

Any other ways to "intercept" the calls to the standard package functions?

It sounds like you're talking about a library that will be used by other applications. You can't (thankfully!) modify the standard library this way - otherwise just importing a package could have incredibly broad and potentially disastrous side-effects. If you want to apply some special hardware-specific optimizations to the standard library, for use by other people in a broad range of projects, your best bet is to make your changes to the standard library and submit a patch.