Does the LDS Church teach that murder is unforgivable? Doctrine and Covenants 42:18 appears to teach that anyone who kills cannot ever be forgiven.
Does &quot;killing&quot; refer only to murder or to any killing, be it in self defense or as part of a way?

And now, behold, I speak unto the church. Thou shalt not kill; and he that kills shall not have forgiveness in this world, nor in the world to come. D&amp;C 42:18

Does the LDS Church hold to this position today?  If so, how is God's forgiveness of David reconciled with that as well as the people mentioned in the book of Alma?

Nathan said to David, “You are the man... You have struck down Uriah the Hittite with the sword and have taken his wife to be your wife and have killed him with the sword of the Ammonites... David said to Nathan, “I have sinned against the LORD.” And Nathan said to David, “The LORD also has put away your sin; you shall not die. 2 Samuel 12 (portions) ESV
And I also thank my God, yea, my great God, that he hath granted unto us that we might repent of these things, and also that he hath forgiven us of those our many sins and murders which we have committed, and taken away the guilt from our hearts, through the merits of his Son.  Alma 24:10
Short answer: Yes, sorta.

Long answer:

Murder is a very serious sin, and while it can't be forgiven it can be pardoned. Also it will stop you from doing or holding certain church offices. See paragraph 4 of this article for more on why D&amp;C 42 says it is unforgivable.

Now to address your scripture reference. 


  Book of Mormon: Alma 24: 10) And I also thank my God, yea, my great God, that he hath granted unto us that we might repent of these things, and also that he hath forgiven us of those our many sins and murders which we have committed and taken away the guilt from our hearts though the merits of his Son.


Hopefully
this excerpt strait from the D&amp;C study guide on chapter 42, can shed some light on the Alma scripture.


  “The second most serious sin is to commit murder—that is, to willfully shed innocent blood. Concerning this sin, the Lord has said: ‘Thou shalt not kill; and he that kills shall not have forgiveness in this world, nor in the world to come.’ (D&amp;C 42:18.) Thus this is an unforgivable sin, which means that Jesus Christ cannot pay for (or ‘atone for’ or ‘forgive’) the penalty demanded by the broken law. This sin is a pardonable sin, however; that is, the sinner can eventually make full payment himself, and be received into a state of pardon. Apparently one reason this sin is unforgivable is that forgiveness is based upon repentance, and a murderer cannot fully repent of his sin for he cannot make restitution of the life he has taken” (Daniel H. Ludlow,A Companion to Your Study of the Book of Mormon[1976], 222).


Missionaries of the LDS Church, have to refer anyone who has confessed to murder and who wants to be baptized, or even taught!, to their direct head, the president of their mission. The president will then refer the case to the First Presidency of the Church (if warranted). The First Presidency then reviews each case and makes a determination on a case by case basis. 

The LDS Church views only one sin as truly unforgivable(and unpardonable). That is the sin of Denying the Holy Ghost. This in turn is something that is extremely difficult to do. (I.E not something the average member is going to do).

In order to do this you must have a sure witness of Christ and then deny Him.

The easiest example of this is Cain, he walked and talked with God and yet denied God when he followed the devil and killed his brother. He is referred to as a 'Son of Perdition'.