I am aware that the devs have stated they won't add firearms to the game, however, in case they change their mind, I think i've found a good way of implementing them. To keep it balanced and in the late medieval/early industrial theme of the game, I believe there should be only muzzle loaders and their variants, but first let's take a look at the crafting materials:
Crafting materials:
Stock: made by placing a hammer, chisel and 4 logs in a horizontal L shape on the crafting spot. For variation, each type of log results in a different color of stock (not really necessary but it would be cool).
Hammer: Made from an iron ingot, either on an anvil or through crafting (dev's choice). Used to make the flintlock.
Flintlock: hammer + flint. Used to fire the gun
Barrel: Made from 2 ingots (Bronze, iron or steel. More on that on the guns), either on an anvil or through crafting (dev's choice). Better materials increases the durability of the gun.
Short barrel: saw + barrel = 2 short barrels
Rifled barrel: barrel + rifling tool/machine
Trigger mechanism: Made from an iron ingot, either on an anvil or through crafting (dev's choice).
Lead ball: the basic ammo type, combined with blasting powder and linen, fires a single shot out of the gun. 16 can be made from casting 100 lead units into a bullet mold (made from clay, like the other molds.
Ramshot (buckshot irl): Made from hammer, chisel and a lead ball (not realistic i know, but pratical for the game). Combined with blasting powder and linen, fires 4 shots out of the gun in a small spread. Used for dealing more damage at a short distance.
Foxshot (birdshot irl): Made from hammer, chisel and ramshot (not realistic i know, but pratical for the game). Combined with blasting powder and linen, fires 16 or 24 (dev preference) shots out of the gun in a large spread. Used to increase the chance of hitting small animals at a short distance (a quarter of the shots should be enough to one shot a rabbit or a raccoon).
Flintlock + stock + trigger mechanism + barrel = gun. The type of barrel determines the type of gun, which results in 3 types:
Blunderbuss (image for reference):
Crafted from using a short barrel made of either bronze, iron or steel. The abillity to fire all 3 ammo types combined with the fastest reload rate (irl this type of gun is easier to reload due to the short trumpet shaped barrel) makes this the most pratical gun at the cost of range.
Reload time: 20 seconds. (subject to change)
Accuracy: Spread 1 block wide at 3, 7 and 10 meters of distance for foxshot, ramshot and leadball respectivaly. (subject to change)
Smoothbore musket (Gun for reference ):
Crafted from using a barrel made of either iron or steel. It's a middle ground between the other 2 types by being able to shoot ramshot and have more range than the blunderbuss.
Reload time: 25 seconds. (subject to change)
Accuracy: Spread 1 block wide at 10 and 20 meters of distance for ramshot and leadball respectivaly. (subject to change)
Rifled Musket (Gun for reference):
Crafted from using a rifled barrel made of steel. It's the best gun for long range shooting at the cost of reload rate (the rifling makes the gun harder to load) and durability (this gun should have less durability than the other two made from steel, since rifled barrels wear faster than smoothbore ones). Shoots only lead ball ammo.
Reload time: 30 seconds. (subject to change)
Accuracy: Spread 1 block wide at 50 meters of distance. (subject to change)
With these 3 types, there is a progression of technology while still making all of them useful in the late game. The long reload rate and high cost makes it so that bows and javelins aren't irrelevant as ranged weapons, but the high damage makes them a good option.
These items and mechanics should be enough to make firearms an interesting addition to the game. There is another thing that I don't think is necessary, but it could be an interesting addition:
Cleaning:
Blackpowder firearms produce a lot of fouling, to the point where the barrel becomes so thight it's impossible to load the gun, as a result they require frequent cleaning. This could be implemented as secondary durability stat which prevents you from reloading the gun if goes down to 0, that stat can be reset by "cleaning" the gun with a stick (or a cleaning rod), linen and 1L of water on the crafting spot. Not only this adds realism, it also further balances the 3 guns by making the "higher tier" ones require more frequent cleaning (IRL smoothbore muskets are less affected by fouling, allowing for more shots before needing to clean the gun).
With all of this said, since we already have gunpowder and explosives, I believe that by making them a high damage-low rate of fire weapons that are only available in the late game, this could be a good addition to the game without making it too out of place in the game. If this is still rejected by the devs, feel free to copy this for your own mod, I don't have the time (or patience) to add this to the game myself.