Firstly, I don't know about those times, but let's assume you're right. You don't generally write C or C++ code that Unity will compile. You would compile your code to a DLL and include that DLL in your Unity project. As such, there would be no compile times for that specific DLL. It's not a bad practice if you've got a library that you don't need to compile often.
Another method to reduce compile times is to use Assembly definitions. This does a very similar thing to compiling your library in to DLLs, but is done "within the Editor". The basic premise is that once a project is compiled, it doesn't need to be compiled again unless there were changes made to it.
The Unity Docs here go into full detail.