How can I enter safe mode with the built in keyboard broken? Recently I noticed that my mac’s storage is almost full. It showed that “System” took up more than 200 GB. I thought that was ridiculous and googled for a bit.

I found that one solution is to boot my mac in safe mode. Apparently after booting in safe mode “System” will take up a sensible amount of storage.

The problem is, the built in keyboard on my mac is broken (the power button is still ok). I once took it to an Apple Store and they said that one of the wires/connector thingys disconnected or something like that.

So I connected a wireless keyboard via USB (in case you don’t know what I’m talking about, I plug a little USB stick into my mac and the keyboard talks to that via infrared or something like that) and tried to press the shift key with that keyboard.

However, safe mode just won’t boot this way. The progress bar always stuck at 100% and it just wouldn’t show the login screen. I later learned that apparently you can’t boot in safe mode when accessories are connected.

So how can I boot my mac in safe mode?

Note that these options are not available:


fixing my mac’s built-in keyboard
buying a new mac



Side note: I do a lot of iOS development on my mac and uses git for all my projects (20+ repos). For the developers out there, is it true that those files take up a lot of space and are classified as “System”?
Although this might be either a layered problem or an XY-Problem:
There are a few things to consider here.


The broken keyboard.    


Using a directly USB-connected wired keyboard should work. This registers boot key combinations.
Using a directly connected wireless bluetooth keyboard – like a Magic Keyboard from Apple – should work, but it is a little bit finickier. If not done before the situation arose, it might be difficult to pair the Bluetooth keyboard with the Mac though.
A Bluetooth dongle should not work. the dongle is likely not properly operational in the crucial time frame (this  seems to be the current approach so far.)
In all cases it might be a good idea to disconnect all other peripherals anyway.

The exact problem with the internal keyboard is hard to see from the information given. But if it is indeed "one of the wires/connector thingys disconnected or something like that" then it might be worth a shot to open the MacBook and reseat the connector (although that seems bizarre as this would have been quite an easy fix for the AppleStore to apply). Nevertheless, if you cannot insist on the Store to do that for you, and if you cannot resist to do that by yourself: ifixit Step 33 shows the – from your description – most crucial part (be careful and read the entire guide at least three times before taken up a screwdriver for the first time.)

The non-booting Mac with "storage is almost full"
SafeMode is only so powerful: 


  Apple: What is safe mode?
  Safe mode (sometimes called safe boot) is a way to start up your Mac so that it performs certain checks and prevents some software from automatically loading or opening. Starting your Mac in safe mode does the following:
  
  
  Verifies your startup disk and attempts to repair directory issues, if needed
  
  
  Loads only required kernel extensions
  Prevents startup items and login items from opening automatically
  Disables user-installed fonts   
  Deletes font caches, kernel cache, and other system cache files
  
  
  The gains from deleting the caches are sometimes substantial. But SafeMode is no magic bullet either.
  



If the keyboard solutions above fail you might try to boot from another drive (you didn't indicate whether just Shift doesn't work or Option is defunct as well). When booted from another drive you might have much more control and higher gains in accessing your drive and delete some stuff on it.

In older Macs with more standard interfaces for the SSD it might be an option to remove the internal SSD and put it into an external enclosure, and then boot from yet another drive. that other drive should be picked up automatically even if nothing is selected or selectable, if it is bootable at all.

Conclusion

Try a wired USB keyboard. Any one. Shift should be a universal 
constant across all models.