The compiler knows full well how to make proper use of the sbi/cbi/in/out instructions...
IOW, the compiler recognizes assembly? You can write assembly in your C program? You can be an assembler people that uses C? Maybe you're an assembler people and you don't even know it!
Technically, it is correct to say that assembly (or the ultimate machine code) can do it in x cycles, because sbi/cbi/in/out are assembly instructions that aren't compiled, no? If you are using the native instructions for the device I would think they are assembled, not compiled.
A real assembler person can optimize a digital write routine to make it smaller and faster, rather than searching and downloading a better library with other bugs. Because the in/out instructions may be the fastest, but you may want to retain some of the features that are included in a digital write; just not all of them for a particular app... in case you need your pinouts to be flexible for future use/modification, for instance. Tracking down and changing several hundred in/out commands will not be fun.
In PIC architecture, specifically, you can even optimize code in assembly for use within the same page and/or banks when using absolute code. Not that I would recommend it, but you can ditch part of the banking/paging instructions that are done (in this case, redundantly) over and over in a C or in a relocatable assembly code. How much do you want to squeeze out? The sky is the limit. It takes some understanding of the native instructions (i.e. assembly) and structure. You can take shortcuts that are not wise from a global perspective, but which can work exactly fine in a specific situation.